WordPress.org

Support

Support » Plugins and Hacks » Simple Fields » Order Meta box alphabetically

Order Meta box alphabetically

  • Hey, great plugin….

    I have a meta box with a list of values and they are all over the place – I usually use ACF, but the current site im working on is using Simple Fields, so im quite new to them…..

    Is there any way that I can sort the simple field output on the backend in alphabetical order without using Jquery?

    http://wordpress.org/plugins/simple-fields/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Pär Thernström

    @eskapism

    Sure, you can sort it using PHP. It all depends on what field type it is and how you want them ordered. http://php.net/manual/en/function.usort.php is a good start to look up sorting.

    As this applied to a meta box, I found the code within the plugin and just changed it. Our wordpress installation is set to never update due to some heavy mods on all our back-end and plugins.

    On about line 1900 of simple_fields.php I added

    'orderby'=> "title",

    I may be using an old version of simple fields, but maybe for future use this might be a good addition.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order Meta box alphabetically’ is closed to new replies.
Skip to toolbar