add_settings_section [ WordPress Function ]
| Parameters: |
|
| Defined at: |
|
Add a new section to a settings page.
Part of the Settings API. Use this to define new settings sections for an admin page. Show settings sections in your admin page callback function with do_settings_sections(). Add settings fields to your section with add_settings_field()
The $callback argument should be the name of a function that echoes out any content you want to show at the top of the settings section before the actual fields. It can output nothing if you want.
Source
<?php
function add_settings_section($id, $title, $callback, $page) {
global $wp_settings_sections;
if ( 'misc' == $page ) {
_deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) );
$page = 'general';
}
if ( !isset($wp_settings_sections) )
$wp_settings_sections = array();
if ( !isset($wp_settings_sections[$page]) )
$wp_settings_sections[$page] = array();
if ( !isset($wp_settings_sections[$page][$id]) )
$wp_settings_sections[$page][$id] = array();
$wp_settings_sections[$page][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/add settings section « WordPress Codex
Description. 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 ...
codex.wordpress.org - Settings API « WordPress Codex
$section - The section of the settings page in which to show the box (default or a section you added with add_settings_section, look at the page in the source to ...
codex.wordpress.org - settings - How to pass variable to add_settings_section() callback ...
Jun 3, 2011 ... I am attempting to automate, as much as possible, the Settings API function calls for each setting in a Plugin. Looping through the options array, ...
wordpress.stackexchange.com - plugins - Add section (add_settings_section) to a custom page ...
Aug 22, 2011 ... I have a plugin page created with add_submenu_page. I want to add a new section there but nothing happens: add_submenu_page('parent' ...
wordpress.stackexchange.com