WordPress.org

Ready to get started?Download WordPress

Forums

Simple Fields
Order Meta box alphabetically (3 posts)

  1. geblord
    Member
    Posted 11 months ago #

    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/

  2. Pär Thernström
    Member
    Plugin Author

    Posted 11 months ago #

    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.

  3. geblord
    Member
    Posted 10 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.