Thanks for your question. You can use MLA’s Bulk Edit feature or an IPTC/EXIF mapping rule with a Content Template to accomplish your goal.
You can find more information in the “Field-level option/format values” section of the Settings/Media Library Assistant Documentation tab. For example, the entry for str_replace
reads:
,str_replace(s,r) – Replace all occurrences of the “search” string (s) with the “replacement” string (r). If search and replacement are arrays, then str_replace() takes a value from each array and uses them to search and replace on subject. If replace has fewer values than search, then an empty string is used for the rest of replacement values. If search is an array and replace is a string, then this replacement string is used for every value of search. You can find complete information on “search” and “replacement”, including examples, at: https://php.net/manual/en/function.str-replace.php.
For more complex replacement tasks you can investigate the “Regular Expression Features” information in the Documentation, but these are not required for your specific application.
For the example you gave in your post, the Content Template would be:
template:[+post_title,str_replace('liana-mitrea','NEW-NAME')+]
You can use the template on a one-time basis using MLA’s Bulk Edit action in the Media/Assistant submenu:
- Navigate to the Media/Assistant admin screen.
- Check the box to the left of each item you want to edit.
- Pull down the “Bulk Actions” control and select “Edit”.
- Click “Apply” to open the Bulk Edit Area.
- Make the changes you want to apply to the selected items. For example, enter the Content Template given above in the Title Text text box in the right-hand column. This replaces the selected word(s) in the item Title.
- Click “Update” in the lower-right corner of the Bulk Edit area to apply your changes.
- When the operation is complete, click “Refresh” to see the results.
Using the template and the Bulk Edit area should make the job easy. You can also define a mapping rule perform the update:
- Go to the Settings/Media Library Assistant IPTC/EXIF tab.
- If 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.
- Scroll down to the “Standard field mapping” section.
- Locate the “Title” rule entry and click the “Edit” rollover action.
- In the “IPTC Value” dropdown control leave the default “- None (select a value) -” in place.
- In the “EXIF/Template Value” text box enter the Content Template given above.
- In the “Priority” dropdown, select “EXIF”.
- In the “Existing Text” dropdown, select “Replace”. This will apply the update to all of the existing Title values.
- Scroll down to the bottom of the screen and click “Save Changes”.
Once you define a rule you can apply 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 metadata” link to run your rules on this item, then scroll down and look at the “Alternative Text” 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 metadata” button to run your rules on the selected items.
- To map all of your items, stay on the Settings/Media Library Assistant IPTC/EXIF tab and click the “Execute” rollover action for the ALT Text rule. This may take a while.
- The Settings/Media Library Assistant IPTC/EXIF tab also has an “Execute” Bulk Action you can use to apply several rules at once, and an “Execute All Rules” button to run all of the rules against all of your items.
I hope that gives you what you need to accomplish your task. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.