Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#18045 closed enhancement (fixed)

Replace tabled-based settings form markup with do_settings_sections() in Twenty Eleven

Reported by: chipbennett's profile chipbennett Owned by:
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.2
Component: Bundled Theme Keywords: has-patch commit
Focuses: Cc:

Description

Currently, Twenty Eleven uses a hard-coded, table-based markup for its Theme Options page. Patch replaces this markup with do_settings_sections(), corresponding call to add_settings_section(), and calls to add_settings_field() for each Theme Option.

One other, minor change: changed theme_options_render_page() function name to twentyeleven_theme_options_render_page(), to correspond to function prefix best practices.

I would like to add in more inline documentation to this file, in general; but want to get at least a blessed first-pass on the code changes while I work on improving the documentation.

Attachments (3)

theme-options.php.diff (8.8 KB) - added by chipbennett 13 years ago.
implements do_settings_sections(), add_settings_section(), and add_settings_field() to replace hard-coded, table-based settings page markup
18045.diff (9.2 KB) - added by nacin 13 years ago.
18045.2.diff (7.5 KB) - added by nacin 13 years ago.
Refreshed.

Download all attachments as: .zip

Change History (19)

@chipbennett
13 years ago

implements do_settings_sections(), add_settings_section(), and add_settings_field() to replace hard-coded, table-based settings page markup

#1 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.2.1

Moving to 3.2.1. Don't expect it then, but would like to roll it out in a Twenty Eleven point release.

#2 @nacin
13 years ago

  • Component changed from Themes to Bundled Theme

#3 @nacin
13 years ago

  • Priority changed from normal to high

Crap. I'm not sure how we missed theme_options_render_page().

That needs to be fixed.

#4 @chipbennett
13 years ago

Well let me know if there's anything else that needs to be fixed/addressed/polished up in the patch, and I'll get it turned back around.

Or, if you would prefer, I could pull the theme_options_render_page() fix out into its own patch, for expediting?

@nacin
13 years ago

#5 @nacin
13 years ago

  • Keywords needs-testing removed

Attached patch:

  • Moves add_settings_section and add_settings_field calls into twentyeleven_theme_options_init().
  • Removes unneeded $default_options variables from each of the settings fields callbacks.
  • Provides a way to hide the section title, in do_settings_sections.

#6 @nacin
13 years ago

In [18430]:

Twenty Eleven: Prefix theme_options_render_page(). props chipbennett, see #18045. for trunk.

#7 @nacin
13 years ago

In [18431]:

Twenty Eleven: Prefix theme_options_render_page(). props chipbennett, see #18045. for 3.2.

#8 @nacin
13 years ago

  • Milestone changed from 3.2.1 to 3.2.2

Soaking the rest in trunk and punting this to 3.2.2.

#9 @nacin
13 years ago

In [18432]:

Don't echo empty <h3>s if we don't pass a section title to add_settings_section(). see #18045.

#10 @nacin
13 years ago

  • Priority changed from high to normal

@nacin
13 years ago

Refreshed.

#11 @nacin
13 years ago

  • Keywords commit added

Refreshed the patch based on [18430] and [18432]. Patch now just registers the settings section and fields and moves the HTML bits into helper functions. Works great. Happy to soak it in trunk now.

#12 @iandstewart
13 years ago

  • Cc ian@… added

#13 @nacin
13 years ago

In [18455]:

Use the Settings fields/sections API in Twenty Eleven. props chipbennett for initial patch. see #18045. for 3.3.

#14 @nacin
13 years ago

In [18458]:

Fix @sinces in Twenty Eleven. see #18045.

#15 @nacin
13 years ago

  • Keywords fixed-major added

#16 @nacin
13 years ago

  • Keywords fixed-major removed
  • Milestone changed from 3.2.2 to 3.3
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.