Thanks for the positive feedback on the work I put into answering support questions; much appreciated.
In the current MLA version you can create a custom field containing the file size and then use the value in your [mla_gallery]
shortcode to include it in the display. To create the custom field:
- Navigate to the Settings/Media Library Assistant “Custom Fields” tab.
- Make sure the “Enable custom field mapping when adding new media” box is checked. If not, check the box, scroll down to the bottom of the page and click “Save Changes”.
- Scroll down to the “Add a new Field and Mapping Rule” area.
- In the first text box, give your field a name, e.g., “File Size”.
- From the Data Source dropdown list, select “file_size.
- In the “Existing Text” dropdown list, select “Replace”.
- In the “Format” dropdown list, select “Commas”. This will format the values in a more attractive way.
- Click the “MLA Column” check box to make the field available in the Media/Assistant submenu table, if that’s useful for you.
- In the “Option:” dropdown list, select “Text”.
- Click the “Delete NULL Values” checkbox.
- Click the “Add Field and Map All Attachments” button to save your work and create the “File Size” value for the items already in your Media Library.
Once the field is set up you can modify your [mla_gallery]
shortcode to use it in the gallery display. For example, you can add it to the caption:
mla_caption="{+caption+}<br>{+custom:File Size+}"
Your question inspired me to develop an enhancement that will make the file_size
value available in the [mla_gallery]
shortcode without the need to map it to a custom field. I hope to add that to my next version, and I will post an update here when that’s complete. I will leave this topic unresolved until I have a final resolution.
Thanks again for your interest in the plugin and for a question that helped to improve it.