Support » Plugin: Disable Feeds » URLs not interpreted correctly

  • Dan


    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.'/';

Viewing 1 replies (of 1 total)
  • Plugin Author Samir Shah



    I’ve had a look at this and can’t really see where the problem is. The plugin doesn’t manually parse URLs – it just unsets the is_feed property and tells WordPress to find the related content URL. If that fails it tries just to remove the /feed/ portion of the URL.

    I tried to reproduce the issue with the filter you provided above, but that looks like only half of the code required to set up your URLs (you must be editing the URL rewrites somewhere as well).

Viewing 1 replies (of 1 total)
  • The topic ‘URLs not interpreted correctly’ is closed to new replies.