[wp-trac] [WordPress Trac] #23387: Adding priority to individual settings via the settings API.
WordPress Trac
noreply at wordpress.org
Tue Feb 5 11:54:37 UTC 2013
#23387: Adding priority to individual settings via the settings API.
------------------------------------+------------------------------
Reporter: alexmansfield | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.5
Severity: normal | Resolution:
Keywords: has-patch settings-api |
------------------------------------+------------------------------
Changes (by SergeyBiryukov):
* version: trunk => 3.5
Old description:
> Currently there is no way (at least that I could find) to specify the
> order of settings on a settings page (for example, a theme options page).
> Use case: a child theme adding a setting to the parent theme's "Theme
> Options" page has no way of specifying the order in which the new setting
> should be inserted.
>
> I've modified the add_settings_field() function to allow for a priority
> to be set (much like when adding settings to the theme customizer). I
> also added uasort($wp_settings_fields[$page][$section],
> 'compare_priority'); to the do_settings_fields() function, where
> 'compare_priority' is a slightly modified version of the compare function
> used to set the priority of the theme customizer sections.
>
> This patch is loosely related to
> [http://core.trac.wordpress.org/ticket/22487] which adds priority to
> settings sections, but not individual settings.
New description:
Currently there is no way (at least that I could find) to specify the
order of settings on a settings page (for example, a theme options page).
Use case: a child theme adding a setting to the parent theme's "Theme
Options" page has no way of specifying the order in which the new setting
should be inserted.
I've modified the add_settings_field() function to allow for a priority to
be set (much like when adding settings to the theme customizer). I also
added uasort($wp_settings_fields[$page][$section], 'compare_priority'); to
the do_settings_fields() function, where 'compare_priority' is a slightly
modified version of the compare function used to set the priority of the
theme customizer sections.
This patch is loosely related to #22487 which adds priority to settings
sections, but not individual settings.
--
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23387#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list