Open aaronpinero opened 1 month ago
don't know if this is the right solution, but I tried adding the following code at line 169 of class-make-paths-relative-frontend.php:
$body_content = preg_replace(
'/"(http:\/\/|https:\/\/|\/\/)' . preg_quote( $internal_domain, '/' ) . '"/is',
'"/"',
$body_content
);
It seems to work in limited testing.
@aaronpinero Please remove trailing slash from the "Site Addresses" field. In this way, you no longer need to change anything in the code.
There are no trailing slashes in the Site Addresses field.
@aaronpinero Do you have staging website where you can show me the issue? If yes, please connect with me on LinkedIn and share the website details there.
I am working with a mostly clean install of WordPress 6.6 and the Twenty Twenty-Four theme. By default, the theme has a Site Title block in the header with the option "Make title link to home" enabled. This feature works until installing the Make Paths Relative plugin. After installing and configuring the plugin to act on all the links in the body, the site title no longer links to the home page. Inspecting the code I can see the href attribute of this link has become empty. Seems like the plugin is a little too good at removing the absolute URL and doesn't allow for a '/' href to match the home page.