URLs not interpreted correctly
-
Hi, I have a custom filter on “term_link” that changes all category & tag permalinks. Menus acknowledge the new criteria imposed by this filter, but your plugin does not – it assumes that every category URL has the full longwinded hierarchy of parent category/subcategory in the URL by default and your plugin fails to function when someone has a filter to simplify their URL – your plugin fails to recognise the feed requests to my category pages and fails to redirect.
Any chance of an update to address this? Because I can’t find any other plugin like yours and I don’t want to have to create my own modified version of your plugin which may or may not be possible but won’t be easy…
For reference, I have a plugin to remove the /category/ base from all category pages, and my functions.php file contains this code to ensure only the lowest-level category appears in the URL (the parent category, where one exists, doesn’t appear):
add_filter('term_link', 'term_link_filter', 10, 3); function term_link_filter( $url, $term, $taxonomy ) { $lowermost_slug = substr(strrchr(substr($url,0,-1), "/"), 1); return get_site_url().'/'.$lowermost_slug.'/'; }
- The topic ‘URLs not interpreted correctly’ is closed to new replies.