WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Permalinks
Broken Feeds Fix (4 posts)

  1. dustin.thomson
    Member
    Posted 1 year ago #

    Lots of people have been having problems with the feeds when using this plugin, myself included. I have a work-around that works for me.

    More info here: http://dustint.com/post/519/advanced-permalinks-plugin-rss-feed-fix

    Patch file:

    --- advanced-permalinks-0.1.21/advanced-permalinks.php	2012-05-05 09:06:10.000000000 -0600
    +++ advanced-permalinks/advanced-permalinks.php	2012-08-31 14:13:06.006393800 -0600
    @@ -451,13 +451,18 @@
     		// Have we triggered a redirect?
     		if (isset ($vars->query_vars['redirect']))
     		{
    -			if (isset ($vars->query_vars['author_name']))
    +            $didRedirect = false;
    +			if (isset ($vars->query_vars['author_name'])){
     				wp_redirect (get_author_posts_url (0, $vars->query_vars['author_name']));
    -			else if (isset ($vars->query_vars['category_name']))
    +                $didRedirect = true;
    +            }
    +			else if (isset ($vars->query_vars['category_name'])){
     				wp_redirect (get_category_link (get_category_by_path ($vars->query_vars['category_name'])));
    +                $didRedirect = true;
    +            }
    
    -			// Stop anything else
    -			die ();
    +            if($didRedirect)
    +                die();
     		}
    
     		// Workaround for WP 2.3

    Or, if you want to manually modify the plugin, open up the advanced-permalinks.php file in the editor, and change the contents of the parse_request function to be:

    /**
     * Hook into the 'parse_request' action and check if our rewrite rules require a redirection
     *
     * @param array $vars Variables
     * @return array Variables
     **/
    
    function parse_request ($vars)
    {
    	// Have we triggered a redirect?
    	if (isset ($vars->query_vars['redirect']))
    	{
    		$didRedirect = false;
    		if (isset ($vars->query_vars['author_name'])){
    			wp_redirect (get_author_posts_url (0, $vars->query_vars['author_name']));
    			$didRedirect = true;
    		}
    		else if (isset ($vars->query_vars['category_name'])){
    			wp_redirect (get_category_link (get_category_by_path ($vars->query_vars['category_name'])));
    			$didRedirect = true;
    		}
    
    		if($didRedirect)
    			die();
    	}
    
    	// Workaround for WP 2.3
    	global $wp_db_version;
    	if ($wp_db_version > 6000 && isset ($vars->query_vars['category_name']))
    	{
    		$vars->query_vars['category_name'] = str_replace ('.html', '', $vars->query_vars['category_name']);
    		$vars->matched_query               = str_replace ('.html', '', $vars->matched_query);
    	}
    
    	return $vars;
    }

    http://wordpress.org/extend/plugins/advanced-permalinks/

  2. I tested this patch with WP 3.4.2 and r540177 of the Advanced Permalinks plugin from http://plugins.svn.wordpress.org/advanced-permalinks/trunk/ and it fixed the RSS feed issues for me.

  3. jeangalea
    Member
    Posted 1 year ago #

    This needs to be fixed as soon as possible, so many users are being affected.

  4. Cavor
    Member
    Posted 1 year ago #

    Thanks for patch

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic