You can create a content_filter
that will update on the fly meaning that you don’t have to update all previous pictures and it will be the default so you don’t have to worry about your authors. something like this:
function autoadd_rel_prettyPhoto($content) {
global $post;
$pattern = "/(<a(?![^>]*?rel=['\"]prettyPhoto.*)[^>]*?href=['\"][^'\"]+?\.(?:bmp|gif|jpg|jpeg|png)['\"][^\>]*)>/i";
$replacement="$1 rel="prettyPhoto[".$post->ID.']">';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
add_filter("the_content","autoadd_rel_prettyPhoto");
Related Posts:
- Get rid of Another update is currently in progress
- Why are there updates for obsolete WordPress versions?
- No CSS being loaded on backend
- Enable update notification, disable updates
- After updating WP keeps nagging about a newer version. Why?
- WordPress 3.9 Database Update Infinite Loop
- Real automated and unattended wordpress upgrade including plugins
- Prevent/Disable Automatic Update Check
- Why can’t I update username through WordPress API?
- Does set_transient() overwrite/update transient option with same key?
- Permissions to wp-content folder in Windows Server 2012
- Why is Google Webmaster Tools telling me to update WordPress
- Update, add, remove plugins, themes or wordpress behind load balancer
- Update WordPress automatically on its own
- How to force function to run as the last one when saving the post?
- git and local wordpress: how to handle wordpress updates?
- Find out if there is a available core update?
- Using wp-cli to Update WP Networks / Multisite from 3.5.1 to 3.8
- Check if any users are logged in before running update
- “You have the latest version of WordPress. Future security updates will be applied automatically.”
- How do I update a custom theme
- wp core update not working anymore
- How to automatically update on localhost after editing files
- Update Failed: There has been a critical error on your website
- How can I prevent a plugin from searching for updates?
- WordPress load-scripts.php encoding issue
- Can’t update WordPress, need to reboot the VPS
- Plugin for automated upgrade of WordPress core and it’s plugins?
- Deploying Updated or New Plugins That Modify the wp_options Table
- Website not updating – no cache plugins active!
- What are the properties of $item passed in the auto_update_{$type} filter?
- Why does One Click Update fail on localhost using FTP with 777 permissions on site files?
- Auto backup before automatic WordPress updates
- Still Another update is currently in progress by updating WordPress 5.3
- Is there any workaround to a core update still showing after core update if language set to anything other than US English
- Why does WordPress 4.2.2 require FTP to update?
- Why won’t WordPress on localhost find updates?
- How to do an event when any user updates their profile?
- Should I upgrade?
- wordpress update will overwrite files changes?
- How to display user’s nickname by default instead of username
- Updating beyond WordPress 4.2.1 yields “allowed memory size exhausted”
- “The package could not be installed” when updating plugins, themes, and core files on WampServer
- Where can I find the corrent version of my wordpress blog?
- 4.9.5 broke site behind load balancer, forwards to localhost [closed]
- WP-CLI command to update all plugins and core fails when executed from cron
- Error updating WP-CLI
- Jetpack Upgrade fails with WP CLI [closed]
- WordPress 3.8.1 update error
- What file(s) in core control automatic background updates?
- Can’t upgrade WP 5.6 to 5.6.1: version-current.php is missing
- Replace or Alter the wp_version_check() Function
- Cannot update WordPress to 5.2
- Update WordPress – Another update is currently in progress
- Errors when updating plugin through the WordPress plugin repository
- Translation update successful but apparently not
- Which directory should be writable to update wordpress?
- WordPress update messed special characters
- 3.1 update erases customized function page?
- Increased memory usage after updating to wordpress 4.3
- How much maintenance is required to run a WordPress server?
- Can anything go wrong if I let users change their usernames?
- Where can I see all changes for a new WordPress version?
- Update to WordPress 4.7 – Fatal error: Maximum execution time of 30 seconds exceeded
- is wpdb->replace() already sanitized?
- Cannot upgrade anything in vps install (migrated wp)
- Where does wordpress gets its core and plugin updates
- How to back up and up date a site to a newer version?
- Site Cookie Error, Redirection and Blank Pages after Upgrade
- opcache_reset on plugin/theme/core update
- Can’t update WordPress 4.0
- Theme my login and update user meta
- why does installer/update screens not progress on some webhosts?
- Can I Update WordPress 2.9.2. to 3.0.4 from admin
- WordPress managing dates that change in text regularly
- Updating wordpress from my Linux distro’s repository
- Can not save changes after an edit
- Admin keeps showing pending translation update
- mystery checkbox in comments area
- Automating svn updates from a server-side cron job
- Issue after WordPress update
- Plugins download & install fine, wordpress update fails
- Correct procedure for fixing broken WP sites after WP version update
- Update WordPress from non-public machine
- WordPress Auto Updates
- WordPress NOT notifying of new update in dashboard
- Core update of 4.2.3 changes all link to https [duplicate]
- Error on update translation
- Not able to Update wordpress to 4.0
- Custom message when wordpress updates are available
- How can I upgrade wordpress with manual?
- If I place custom files in WordPress root, will they be deleted?
- WordPress 4.8.2 redirects back after install and asks to delete/change config
- Manually updating WordPress files
- Problem updating from 3.6 to 3.7
- Is updating from a zip file the same as a regular update? [closed]
- Hook or function to check if performing a WP Core update?
- cURL error 28: SSL connection timeout while can download the plugin file
- WordPress recommending to downgrade instead of upgrade?
- WordPress is updating only patch version and not minor