WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 14 months ago

#23253 new enhancement

Lack of a do_settings_section (singular) function

Reported by: auniquename Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: administration Cc:

Description

After considerable research I have found that plugin authors, including myself, have to go to great lengths to put options into tabs on a plugin settings page. The majority use JavaScript to modify the DOM in order to achieve this, others have broken their options into several settings arrays instead of the recommended single array to facilitate the creation of tabs using the traditional WordPress nav-tab-wrapper class approach.

To get my own options into tabs in a fully scoped css jquery ui theme I ended up adding my own hacky function to my plugin: myplugin_do_settings_section( $page, $sectionid ) - which is just a copy of the core function do_settings_sections( $page ) with an additional parameter for the section id and an added conditional to only output the section with the requested id.

This allows me to wrap each section in the appropriately classed tags for either jquery ui tabs or traditional WordPress nav-tabs. This however, is not an acceptable long-term solution as the core code will undoubtedly change, I already see tickets and revisions relating to the removal of those nasty tables...

This functionality should be in the core code. A settings section is a section and it should be possible to output them one at a time to allow for styling.

Thanks for considering my proposal.

(Also, the Iris color picker does not play nice with jquery-ui - it needs its own css scope or something - that will be a separate ticket once I have a better understanding of what is wrong with it and have searched for existing tickets on the subject.)

Change History (2)

comment:1 @nacin14 months ago

  • Component changed from Plugins to Admin APIs
  • Focuses administration added

comment:2 @nacin14 months ago

  • Component changed from Admin APIs to Plugins

Sorry for the noise.

Note: See TracTickets for help on using tickets.