WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#7682 closed defect (bug) (fixed)

API for adding settings to default settings pages

Reported by: ryan Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description (last modified by ryan)

Plugins should be able to integrate new settings and new sections of settings into the default settings pages via API.

Attachments (2)

7682.diff (4.0 KB) - added by ryan 7 years ago.
add_settings_section(), add_settings_field
settings_field_test.txt (1.1 KB) - added by ryan 7 years ago.
Test code

Download all attachments as: .zip

Change History (10)

@ryan7 years ago

add_settings_section(), add_settings_field

comment:1 @ryan7 years ago

Patch implements add_settings_section() and add_settings_field() and changes options-writing.php to make use of them.

@ryan7 years ago

Test code

comment:2 @ryan7 years ago

  • Description modified (diff)

comment:3 @ryan6 years ago

(In [8855]) add_settings_section() and add_settings_field(). see #7682

comment:4 @ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

comment:5 @technosailor6 years ago

Anybody confirm this is functional for plugins in 2.7? Doesn't seem to work or maybe I'm missing something.

function myex_conf()
{
  add_settings_section('myex_settings','My Example Settings','myex_settings','reading');
}
add_action('admin_init','myex_conf');

function myex_settings()
{
  echo "foo";
}

comment:6 @technosailor6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The API works fine for writing, discussion, etc - but does not work for reading. Reopening.

comment:7 @ryan6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [10003]) do_settings_sections('reading'). fixes #7682

comment:8 @hakre5 years ago

Related: #7092

Note: See TracTickets for help on using tickets.