Had to change a php file in a WordPress plugin… add a .htaccess redirect to prevent it from being updated by vendor?
Had to change a php file in a WordPress plugin… add a .htaccess redirect to prevent it from being updated by vendor?
I have a client who required a front end change in a WordPress plugin layout when the site displays.
The plugin is a commercial plugin and has already been updated once in the past 2 weeks while I have been working on the site.
I first created a child theme and went about seeing if the plugin would access it there ( for example using the answers from https://wordpress.stackexchange.com/questions/275258/overriding-plugin-template-files-with-child-theme among others ).
So, that didn't work.
Can I create a .htaccess redirect to send the plugin's include to the new file at a new location?
I've tried a few varieties of :
# Redirect the old to the new content archive
Redirect /wp-content/plugins/***/templates/front/property/content-archive.php /wp-content/plugins/content-archive-new.php
and
RedirectMatch "^content-archive\.php$" "/wp-content/plugins/content-archive.php"
Neither loads the new content layout. I could go into the plugins parent page and change the include location but then I am stuck with a page that could be updated by the plugin devs. Contacting the devs may be an idead but I would like to avoid it if possible due to time constraints.
One option is duplicating the whole plugins for this one layout change but then it will never get updated moving forward.
It's 3am and I am tired so I may be missing something completely easy to do. I'll probably slap my forehead as soon as I see a way to do it.
Turbo Multi-language Translator
Make the better internet purchasing globaly
Turbosify SEO Speed Booster
5.0 (7)•Free plan available
Get better conversions by improving store loading speed
Installed
Turbo Multi-language Chat - AI Customer service in one hand