WordPress函数文档add_settings_section()

添加一个设置选项单元 描述 Settings Sections are the groups of setti…

添加一个设置选项单元

描述

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.

用法

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

参数

$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

返回值

(void) 

This function does not return a value.

注意

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

历史

添加于 版本: 2.7.0

源文件

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

相关

Settings API:
register_setting(),
unregister_setting(),
add_settings_field(),
add_settings_section(),
add_settings_error(),
get_settings_errors(),
settings_errors()

  • 原文:http://codex.wordpress.org/Function_Reference/add_settings_section
类别:WordPress函数文档

本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论 (0)COMMENT