Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your kind words and for your question.

    There is no support in the current MLA version for updating Media Library items from the content of a CSV file. However, it would be straightforward to create a small custom plugin that would do something like you propose. Here’s what I imagine:

    1. You install and activate the custom plugin.
    2. A new Tools submenu, e.g., “MLA CSV Updater” appears.
    3. You upload your CSV file to the Media Library.
    4. You navigate to the Tools/MLA CSV Updater submenu, enter the ID of the CSV item and click “Do Updates”.
    5. The custom plugin reads the file and applies the updates.

    I propose adding column headers to the first line of the CSV file to make it a bit more general. The first column would be either “file” or “id”, denoting the file name or the item id as the key. The second column would be something like “title”, “caption”, “description” or “alt_text”, denoting the field to be updated.

    Using the file name can be tricky. First, if you divide the uploads area by year and month you can have the same file name in multiple directories, e.g., 2015/01/file.jpg and 2015/07/file.jpg. Do you have the year and month prefix in your file names, or are you using a “flat” uploads area? Second, if your file name contains spaces or other special characters WordPress will alter the name; is that a problem in your application? Third, if you upload the same file multiple times WordPress will add a suffix to the file name to make it unique. Is that a problem in your application?

    If you can ensure that the file name in your CSV file matches the value in the WordPress _wp_attached_file postmeta field the custom plugin approach should work.

    If this is of interest, let me know and I will try to put something together. Thanks for your interest in the plugin.

    Plugin Author David Lingren

    (@dglingren)

    It has been two months since my past post in this topic. I assume you have found some other solution to your “Bulk Add Unique Captions” application.

    I am marking this topic resolved, but please update it if there is anything else I can do to help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bulk Add Unique Captions’ is closed to new replies.