[wp-trac] [WordPress Trac] #22487: Adding priority to settings sections.
WordPress Trac
noreply at wordpress.org
Sat Nov 17 09:08:35 UTC 2012
#22487: Adding priority to settings sections.
-----------------------------+-------------------------
Reporter: alexmansfield | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: General
Version: | Severity: normal
Keywords: has-patch |
-----------------------------+-------------------------
Currently there is no way (at least that I could find) to specify the
order of settings sections on a settings page (for example, a theme
options page). Use case: a child theme adding a settings section to the
parent theme's "Theme Options" page has no way of specifying where on the
page the new section should be placed.
I've modified the add_settings_section() function to allow for a priority
to be set (much like when adding sections to the theme customizer). I also
added `uasort($wp_settings_sections[$page], 'compare_priority');` to the
do_settings_section() function, where 'compare_priority' is a slightly
modified version of the compare function used to set the priority of the
theme customizer sections. The patch is based on version 3.4.2, but I'd be
happy to make another for the development version if that would help.
This is my first patch submitted, so please let me know if I need to do
anything differently. Thanks!
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22487>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list