add_settings_section()添加一个设置选项单元

目录

描述

Settings Sections are the groups of settings you see on WordPress settings pages with a shared heading. In your plugin you can add new sections to existing settings pages rather than creating a whole new page. This makes your plugin simpler to maintain and creates less new pages for users to learn. You just tell them to change your setting on the relevant existing page.

add_settings_section() 描述

用法

<?php add_settings_section$id$title$callback$page ); ?>

add_settings_section() 用法

参数

$id

(string) (必填) String for use in the 'id' attribute of tags.

默认值: None

$title

(string) (必填) Title of the section.

默认值: None

$callback

(string) (必填) Function that fills the section with the desired content. The function should echo its output.

默认值: None

$page

(string) (必填) The menu page on which to display this section. Should match $menu_slug from Function Reference/add theme page

默认值: None

add_settings_section() 参数

返回值

(void) 

This function does not return a value.

add_settings_section() 返回值

注意

The callback function receives a single optional argument, which is an array with three elements.
Example:

add_settings_section() 注意

历史

添加于 版本: 2.7.0

add_settings_section() 历史

源文件

add_settings_section() 函数的代码位于 wp-admin/includes/template.php.

add_settings_section() 源文件

相关