@jblifestyles Currently, there is one filter that you can use to use full paths.
add_filter( 'paths_relative', 'yasglobal_change_path' );
You can find the example here:
https://github.com/yasglobal/make-paths-relative#filters
Please make sure to make adjustments as per your need. I will introduce another filter or setting to avoid it on the Admin pages.
Thanks & Regards,
Sami
In this case, you are suggesting this?
function yasglobal_change_path( $link ) {
if(strpos($link,'/wp-admin') !== false || strpos($link,'/wp-includes' !== false) {
$link = site_url().$link';
}
return $link;
}
add_filter( 'paths_relative', 'yasglobal_change_path' );
-
This reply was modified 1 year, 8 months ago by
Jake Bohall.
@jblifestyles Yes, Have you tried it?
Not yet.. I’m trying to pair this solution with another issue I have…
We are actually running the site behind a reverse proxy and the admin section is accessed on a different hostname than the production site (intentional for security, etc.)
When we use relative paths, this works great for caching, etc.. but then it also breaks some functionality (e.g. when we try to use visual editors, it tries to interact with cache vs. origin). We are also seeing the backend issue pop up (multi-site) for the child sites that are set at a subdirectory.
I’m trying to think of a better solution and am going to test relative path is “disabled” completely for logged in users, as I think that may work better to solve the larger problems
E.g.
function yasglobal_change_path( $link ) {
if ( is_user_logged_in() ) {
$link = site_url().$link';
}
return $link;
}
add_filter( 'paths_relative', 'yasglobal_change_path' );