[Plugin: WP Subdomains] Bugfix: category name in post_name is replaced
-
I found a bug in the changePostPath() function inside plugin/classes.php.
If you use a post name containing the category name, an invalid permalink is produced in certain cases.
My permalink structure is: /%category%/%postname%/%postid%
Supposing the category is “chicago” if I publish a post with a slug like “places-where-to-eat-in-chicago/1823/” the plugin will produce
“places-where-to-eat-in1823” thus breaking the link integrity.
The patch is:
// replace
$path = str_replace( $original_path, $new_path, $path );// with
$path = preg_replace( “@$original_path@”, $new_path, $path, 1);limiting the replacement of the category name to 1 occurrence only.
Hope it may help.
- The topic ‘[Plugin: WP Subdomains] Bugfix: category name in post_name is replaced’ is closed to new replies.