Title: Replacing Sort Order attribute
Last modified: September 1, 2016

---

# Replacing Sort Order attribute

 *  Resolved [ciano](https://wordpress.org/support/users/ciano/)
 * (@ciano)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/replacing-sort-order-attribute/)
 * Hi David,
 * Love the plugin. I’m stuck trying to communicate a custom sort order from Lightroom
   to WordPress. I can sort my photos in Lightroom and export the custom sort order
   to the otherwise unused 2#103 IPTC field.
 * I was using the plugin Enhanced Media Library to give photos a sort order. This
   seems to use a database field called menu_order. So I’ve been trying to map the
   2#103 IPTC field to menu_order in order to export a sort order directly from 
   Lightroom.
 * In the IPTC/EXIF section of the settings I’ve mapped 2#103 IPTC field to a custom
   field called ‘Test’. When I view the Test I can see my Lightroom exported custom
   sort number.
    What I can’t seem to figure out, is how to overwrite the existing
   menu_order field, instead of creating a new field. I’ve tried so many different
   things, and nothing seems to be working.
 * Hope you can help. Thanks.
 * [https://wordpress.org/plugins/media-library-assistant/](https://wordpress.org/plugins/media-library-assistant/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/replacing-sort-order-attribute/#post-7636102)
 * Thanks for the positive feedback and for your question. Thanks as well for explaining
   how you use Lightroom to manage the sort order, which provides a motivation for
   the question.
 * You probably know that once the custom field is set up you can use it to sort
   the items in an `[mla_gallery]` shortcode. I’d be interested in your other uses
   for `menu_order`, which is one of the WordPress Standard Fields.
 * In any case, it might make sense to expand the set of Standard Fields available
   in the MLA IPTC/EXIF mapping rules and the Bulk Edit area. I will investigate
   the work required to do that and any associated risks.
 * You could also adapt the “MLA Simple Mapping Hooks Example” plugin to do the 
   job. That example was developed for this earlier topic:
 * [Using media Path to populate att. Category](https://wordpress.org/support/topic/using-media-path-to-populate-att-category?replies=4#post-6225711)
 * I will leave this topic unresolved for now and post an update when I’ve completed
   my investigation on adding `menu_order` to the Standard Fields set. Thanks for
   your interest in the plugin.
 *  Thread Starter [ciano](https://wordpress.org/support/users/ciano/)
 * (@ciano)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/replacing-sort-order-attribute/#post-7636142)
 * Hi David,
 * Thanks for the quick response.
 * The reason I’m interested in menu_order is that the theme I use has the ability
   to show a slideshow of images as the background. It uses its own protocol in 
   order to create a gallery in a page/post’s options. I found that to avoid sorting
   my photos three times (once in lightroom for my own use, once for the standard
   gallery, once for the themes background), I could use Enhanced Media Library 
   to sort my photos and populate the menu_order field which both mla gallery and
   the theme take advantage of. This means I have just been sorting twice, once 
   in Lightroom and once using Enhanced Media Library.
 * I’ve now discovered a way to export the sort order I use in Lightroom into the
   2#103 IPTC field using a Lightroom plugin called L/R Transporter. This means 
   that in theory I will only need to sort a gallery of images (a wedding for example)
   one time only in Lightroom, and then have that populated into the menu_order 
   field and used automatically by both mla gallery and my theme.
 * The problem here of course is in actually getting it into the menu_order field.
   I had a look at the Mapping Hook Example and the link you posted me to, and started
   trying to amend it, but unfortunately I was way out of my depth and ended up 
   spending a half hour going round in circles and scratching my head!
 * I’m happy enough for the time being to just use a static image as my post/page
   background, as the slideshow bg is just a nice but unnecessary extra. I can sort
   using a custom field in [mla_gallery] to display my Lightroom sort order. It 
   would be really cool though if you managed to add menu_order to the standard 
   mappings.
 * Thanks again for the help.
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/replacing-sort-order-attribute/#post-7636256)
 * Thanks for your update and the detailed explanation of your application logic.
   After some deliberation I decided to add this feature to one of the MLA Example
   Plugins instead of embedding it in the MLA core.
 * I have released an MLA Development Version dated 20160811 that contains the updated
   example plugin. To get the Development Version, follow the instructions in this
   earlier topic:
 * [Shortcode not working in (special) widget](https://wordpress.org/support/topic/shortcode-not-working-in-special-widget?replies=3#post-7753687)
 * After you install the Development Version you can easily install the example 
   plugin. Navigate to the Settings/Media library Assistant Documentation tab and
   click the “Example Plugins” button. You will see a new submenu that lists all
   the example plugins and give you a “one-click” action for installing them. I 
   hope this will make future installations of the example plugins more convenient
   for all MLA users.
 * You are looking for “MLA Simple Mapping Hooks Example” plugin. Find that plugin
   and hover over the title in the left-most column. Click the “Install” rollover
   action, then go to the Plugins/Installed Plugins submenu and activate it.
 * To put the new example to work you must define a new IPTC/EXIF mapping rule along
   the lines of your earlier rule for the “Test” custom field. Create a new rule
   and enter “update_menu_order” in the custom field name text box. Enter the other
   rule settings as you did for “Test”; make sure “Existing Text” is set to “Replace”.
 * Once that’s done you can use the “Add Field” to save the rule or the “Add Field
   and Map All Attachments” button to go back and set the menu_order field for your
   existing items, if that is appropriate. You can use the Media/Assistant Bulk 
   Edit area or the Media/Edit Media screen to make more selective replacements.
   Look for the Map IPTC/EXIF Metadata button on either of those screens.
 * It would be great if you can install the Development Version and let me know 
   how it works for you. I will leave this topic unresolved until I hear back from
   you.
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/replacing-sort-order-attribute/#post-7636265)
 * I have released MLA Version 2.32, which includes the new example plugin that 
   supports your application. I am marking this topic resolved, but please update
   it if you have any problems or further questions regarding the solution outlined
   above. Thank you for your interest in the plugin.
 *  Thread Starter [ciano](https://wordpress.org/support/users/ciano/)
 * (@ciano)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/replacing-sort-order-attribute/#post-7636273)
 * I’ve just updated to MLA Version 2.32 and followed your instructions and am happy
   to report that everything is now working perfectly.
 * Thanks for the excellent help.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Replacing Sort Order attribute’ is closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

## Tags

 * [sort order](https://wordpress.org/support/topic-tag/sort-order/)

 * 5 replies
 * 2 participants
 * Last reply from: [ciano](https://wordpress.org/support/users/ciano/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/replacing-sort-order-attribute/#post-7636273)
 * Status: resolved