Support » Plugin: Media Library Assistant » Announcing the MLA Filename Issues Example plugin

  • Plugin Author David Lingren


    I have developed a new MLA example plugin, “MLA Filename Issues Example”, to add a custom data source that facilitates a solution for the requirements outlined in this earlier support topic:

    Find media duplicates based on file name

    @bkwineper – The earlier topic is closed to new replies so I am starting this new topic. If you find it, post a reply so we can continue the dialog.

    I have uploaded a new MLA Development Version dated 20210906 that includes the new plugin. You can find step-by-step instructions for using the Development Version in this earlier topic:

    PHP Warning on media upload with Polylang

    Once the Development Version is installed you must install and activate the example plugin. Navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “filename” in the text box and click “Search Plugins” to filter the table.

    You are looking for the “MLA Filename Issues Example” plugin. Find that plugin and hover over the title in the left-most column. Click the “Install” rollover action, then go to the WordPress Plugins/Installed Plugins submenu and activate the example plugin as you would any other plugin.

    Once the Development Version and new example plugin are installed and active you can adapt the solution we developed for your earlier, similar topic:

    How to find and list orphans only?

    Briefly, the solution has two parts: 1) create a custom field to record the filename issues for your items, and 2) filter the Media/Assistant submenu table on the custom field values.

    For part 1), follow these steps:

    1. Navigate to the Settings/Media Library Assistant “Custom Fields” tab.
    2. Scroll down to the “Add New Custom Field Rule” area below the “Enable” checkboxes.
    3. Under the “Name” dropdown control, click “Enter new field” to create a new custom field.
    4. In the “Name” text box, give your field a name, e.g., “Filename Issues”.
    5. From the Data Source dropdown list, select “– Template (see below) –”.
    6. In the Meta/Template text box, enter [+filename_issues+].
    7. Click the “MLA Column” check box to make the field available in the Media/Assistant submenu table. Leave the “Quick Edit” and “Bulk Edit” check boxes unchecked for this solution.
    8. In the “Existing Text” dropdown list, select “Replace”.
    9. In the “Format” dropdown list, select “Native”.
    10. In the “Option:” dropdown list, select “Text”.
    11. Click the “Delete NULL Values” checkbox.
    12. Leave the “Status” set to “Active”.
    13. Click the “Add Rule” button to save your work.

    Once the rule is created you must execute it to create the “Ref Issues” value for the items in your Media Library:

    1. Find the “Filename Issues” (or your chosen field name) in the table of rules on the right-hand side of the screen. If you don’t see your new rule, type the name you gave it in the search box above the table and click “Search Rules”.
    2. Hover your mouse in the “Name” column and click the “Execute” rollover action.
    3. Wait for the mapping process to complete.

    At this point you can, if you like, set your new rule to “inactive” so it won’t run when new items are added to the Media Library.

    To check your progress, navigate to the Media/Assistant admin screen and look for your new column. If you don’t see the “Filename Issues” column in the Media/Assistant submenu table pull down the “Screen Options” area and make sure that “Filename Issues” is listed and the box next to it is checked.

    You can sort on this column to bring the items that have one or more issues to the front of the table. You can click on a value in the column to filter the table by that value. To make the filtering more convenient, proceed with part 2) of the solution:

    1. Navigate to the Settings/Media Library Assistant General tab.
    2. Scroll down to the “Taxonomy Support” section.
    3. At the bottom of the taxonomy table you will see a dropdown control. Select your “Filename Issues” custom field.
    4. Click the radio button in the “List Filter” column to filter the Media/Assistant submenu table by the custom field values.
    5. Scroll to the bottom of the page and click “Save Changes” to record your new settings.

    When you return to the Media/Assistant screen you should see something like “All Filename Issues” in the dropdown control above the table. Click on that to select one of the “issues” values, then click “Filter” to filter the table by that value.

    If this is a one-time or infrequent task you can go back to the General tab and reset the taxonomy filter to Att. Categories or another taxonomy. You can then go to the Custom Fields tab, use the “Purge Values” rollover action for your rule to delete the custom field values and set the rule to “Inactive” status for future use or delete it entirely.

    This example plugin will be part of my next MLA version, but in the interim it would be great if you could install the Development Version and the example plugin and let me know if it works for you. Thanks for inspiring this long-wanted MLA improvement.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks for tagging me. This sounds really interesting. This is a really busy time of the year for me so I won’t have time to dig into this until probably late October. Sorry about that but thanks for letting me know!

    Plugin Author David Lingren


    Thanks for your response. You’ve waited a long time for the solution, so I can be patient in awaiting your results.

    I will leave this topic unresolved until I hear back from you. Thanks for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.