Opened 5 years ago

Closed 4 years ago

Last modified 3 years ago

#7682 closed defect (bug) (fixed)

API for adding settings to default settings pages

Reported by: ryan Owned by: anonymous
Priority: normal Milestone: 2.7
Component: General Version:
Severity: normal Keywords:
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 5 years ago.
add_settings_section(), add_settings_field
settings_field_test.txt (1.1 KB) - added by ryan 5 years ago.
Test code

Download all attachments as: .zip

Change History (10)

ryan5 years ago

add_settings_section(), add_settings_field

comment:1   ryan5 years ago

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

ryan5 years ago

Test code

comment:2   ryan5 years ago

  • Description modified (diff)

comment:3   ryan5 years ago

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

comment:4   ryan5 years ago

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

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";
}
  • 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   ryan4 years ago

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

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

Related: #7092

Note: See TracTickets for help on using tickets.