• Resolved Josh Journey

    (@ljosh)


    Howdy, hoping you’re having a good week. ??

    Is it possible for newly uploaded photos to inherit the tags from the parent_post they are uploaded to? For example if I was editing a post named ‘Desert Rain Frog’ that has 2 tags: ‘Frog, Desert Rain Frog’, I’d like each uploaded photo to that post to be assigned the tags ‘Frog, Desert Rain Frog’.

    Regards, Josh

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

    (@dglingren)

    Thanks for your question. You can accomplish your goal by combining one of MLA’s Example Plugins with an IPTC/EXIF/WP mapping rule.

    First, make sure the “Tags” taxonomy is supported in MLA:

    1. Navigate to the Settings/Media Library Assistant General tab.
    2. Scroll down to the “Taxonomy Support” section.
    3. Find your taxonomy in the list and select the MLA options you want for it.
    4. Scroll to the bottom and click “Save Changes” to record your new settings.

    By default, the WordPress “Tags” and “Categories” taxonomies are not available for Media Library items.

    Second, you must install (or update) and activate the example plugin that makes parent post/page terms available as a data source. Navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “substitution ” in the text box and click “Search Plugins” to filter the table.

    You are looking for the “MLA Substitution Parameter Hooks Example” plugin. Find that plugin and hover over the title in the left-most column. Click the “Install” (or “update”) rollover action, then go to the WordPress Plugins/Installed Plugins submenu and activate the example plugin as you would any other plugin. Make sure you have the latest version, 1.15, installed.

    Third, once the example plugin is installed and active you can define your mapping rule:

    1. Go to the Settings/Media Library Assistant IPTC/EXIF/WP tab.
    2. Since you want to apply the rule to new items as they are uploaded, check the “Enable IPTC/EXIF Mapping when adding new media” and “Enable IPTC/EXIF Mapping when updating media metadata” boxes.
    3. Find the rule name that corresponds to the taxonomy you are using, e.g., Tags. You could use any other supported taxonomy, e.g., Att. Tags, as well.
    4. Hover over the rule name and click the “Edit” rollover action.
    5. In the “IPTC Value” dropdown control leave the default, “- None (select a value) -” value in place.
    6. In the “EXIF/Template Value” text box, enter template:([+parent_terms:post_tag+]). This assigns the terms named in the parent post/page. The parentheses ensure that only items with one or more parent post/page terms are affected.
    7. In the “Priority” dropdown, select “EXIF”.
    8. In the “Existing Text” dropdown, select “Replace” to replace the current field content, or select “Keep” to retain any terms assigned by other means.
    9. Leave the default values in the “Option” and “Delimiters” boxes.
    10. In the “Status” text box, select “Active”.
    11. Scroll down to the bottom of the screen and click “Update”.

    Once you define the rule you can update existing items by applying it to a single item, multiple items or all items:

    • To map a single item, go to the Media/Assistant submenu and click the thumbnail of the item you want (or click the “Edit” rollover action) to get the Media/Edit Media screen. You can click the “Map IPTC/EXIF/WP metadata” link to run your rules on this item, then look at the “Tags” (or “Att. Tags”) meta box to inspect the results.
    • To map two or more items, go to the Media/Assistant submenu and click the checkbox next to the items you want. Then, select “Edit” from the “Bulk Actions” dropdown above the checkboxes and click “Apply” to open the Bulk Edit area. Click the “Map IPTC/EXIF/WP metadata” button to run your rule on the selected items.
    • To map all of your items, stay on the Settings/Media Library Assistant IPTC/EXIF/WP tab and click the “Execute” rollover action for your custom rule. This may take a while.

    The first two methods will apply all active rules to the selected item(s). This won’t be a problem if you have only the one rule, but the third method might be the best if you have other rules in place.

    I hope that gives you the results you want. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above solution. Thanks for your interest in the plugin.

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