Change url when image is inserted to post content
-
Hi all,
I’m wondering if this is possible. When inserting an image or attachment in the post content, WP automatically adds the blog url in the path to the file. I would like to change this behaviour. Is there a hook that I can filter to modify this? I would like to use a shortcode instead of having the url hard coded.The reason is that sometimes we have a testing environment to show clients what changes would look like and then roll out the changes to the production environment once approved. It would be so much easier to copy over the entire database table instead of having to manage to tables in tandem where the only difference is the test/production url.
I’m hoping there’s a solution that can be done through our theme’s functions.php file as opposed to modifying core WP files. We’ve already set up the shortcode, but are now looking into getting WP to use it as well.
Any help will be greatly appreciated!
Thanks
- The topic ‘Change url when image is inserted to post content’ is closed to new replies.