add_settings_section ( $id, $title, $callback, $page, $args = array() )

  • (string) id Slug-name to identify the section. Used in the 'id' attribute of tags.
  • (string) title Formatted title of the section. Shown as the heading for the section.
  • (callable) callback Function that echos out any content at the top of the section (between heading and fields).
  • (string) page The slug-name of the settings page on which to show the section. Built-in pages include 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using add_options_page();
  • (array) args { Arguments used to create the settings section. @type string $before_section HTML content to prepend to the section's HTML output. Receives the section's class name as `%s`. Default empty. @type string $after_section HTML content to append to the section's HTML output. Default empty. @type string $section_class The class name to use for the section. Default empty. }
Defined at:
Change Log:
  • 6: .


Adds 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.

Related Functions

do_settings_sections, add_settings_error, add_settings_field, do_settings_fields, settings_errors

Top Google Results

User discussions

wpseek mobile