Make WordPress Core

Opened 11 years ago

Closed 8 years ago

#23387 closed enhancement (wontfix)

Adding priority to individual settings via the settings API.

Reported by: alexmansfield's profile alexmansfield Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5
Component: Plugins Keywords: has-patch settings-api
Focuses: administration Cc:

Description (last modified by SergeyBiryukov)

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.

Attachments (1)

setting-priority.patch (1.8 KB) - added by alexmansfield 11 years ago.
Adds priority option to individual settings

Download all attachments as: .zip

Change History (7)

@alexmansfield
11 years ago

Adds priority option to individual settings

#1 @alexmansfield
11 years ago

  • Keywords settings-api added

#2 @SergeyBiryukov
11 years ago

  • Description modified (diff)
  • Version changed from trunk to 3.5

#3 @nacin
10 years ago

  • Component changed from General to Plugins

#4 @nacin
10 years ago

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

#5 @nacin
10 years ago

  • Component changed from Admin APIs to Plugins

Sorry for the noise.

#6 @DrewAPicture
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

No activity or further interest in 2 years. Closing as wontfix.

Note: See TracTickets for help on using tickets.