WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 3.1 rewrites (12 posts)

  1. w03d
    Member
    Posted 3 years ago #

    Hello,
    After upgrading to 3.1 a plugin that I use for custom rss feeds partially works.

    Plugin uses url: http://www.site.com/?feed=custom to display custom output. This still works OK.

    If the url begins with category: http://www.site.com/mycategory/?feed=custom it is now translated to http://www.site.com/mycategory/feed/custom and redirects to 404.

    Plugin uses this method to see if it should do custom output:

    $method = get_query_var('feed');
    if (empty($method)) {
    return false;
    } else if ($method == "custom") {
    do_stuff();
    exit;
    }

    How can I make this work again in 3.1 or can I downgrade to get previous behavior?

    Thanks!

  2. What's the plugin? Can you link to it?

  3. w03d
    Member
    Posted 3 years ago #

  4. w03d
    Member
    Posted 3 years ago #

    The above mentioned get_query_var now seems to work only if argument is passed directly to index.php. Passing argument in url after category name does not work as before 3.1.

    I would like to know what would be a proper way of extending WP 3.1 to recognize my custom argument as a feed type like it does with "rss", "rss2" and "atom"? They seem to work OK both on index.php and categories/tags etc.

    Can anyone point me to article on how to do this?

    Thank you

  5. Possibly related to this... http://core.trac.wordpress.org/ticket/16639

  6. w03d
    Member
    Posted 3 years ago #

    Ipstenu,
    You are a life saver!

    remove_filter('template_redirect', 'redirect_canonical'); did the trick, although I am on debian lenny/apache2 setup.

    Thanks a lot!

  7. joemcgill
    Member
    Posted 3 years ago #

    I believe that this issue is also causing the plugin "The Events Calendar" to fail to do template re-writes when the site's permalink structure includes %category% in the url.

    See this link in the forum: http://wordpress.org/support/topic/plugin-the-events-calendar-compatibility-with-wordpress-31

  8. Ryan Boren
    WordPress Dev
    Posted 3 years ago #

    Feeds should be registered with add_feed(). Plugins that use add_feed() rather than going going around it will not break like this in 3.1.

    Canonical redirects for categories were fixed in 3.1. This fix results in the bad behavior you are seeing if the plugin does not use add_feed(). We might change WP to avoid doing canonical redirects for unregistered feeds, but plugins really should be using add_feed().

  9. w03d
    Member
    Posted 3 years ago #

    Thank Ryan,
    I will definitely look into fixing it the right way.

    Will add_feed() support multiple arguments like ?feed=custom&page=2 or just first one?

    Thanks a lot!

  10. Ryan Boren
    WordPress Dev
    Posted 3 years ago #

    add_feed() just registers the callback for feed queries. add_feed('custom', 'callback_function_that_outputs_the_feed'). You don't have to worry with what is in the url. ?feed=custom or /feed/custom/ or /feed/custom/?hey=you will trigger the callback.

    I opened a ticket for turning off canonical redirects for unregistered feeds:

    http://core.trac.wordpress.org/ticket/16704

  11. w03d
    Member
    Posted 3 years ago #

    Ecellent,
    I will change this ASAP.

    Thank You!

  12. thrilom
    Member
    Posted 3 years ago #

    I have a huge issue with "The Events Calendar" my site is promotersgala.com I have had this plugin on my site for my upgrade to wp 3.1 and it was working fine until I tried to add my sidebar and I also changed the div id and class wrapping the calendar to id="main-content" and class="main-content-other" I am using the Reviewit theme and also buddy press. The first issue is that the calendar suddenly appears on my home page and not my post widget. I cant get rid on the calendar unless i deactivate it. Also my widget displaying "Industry professionals" breaks as well it takes you to a calendar page when it should take you to the users website/profile. Please help I need this back to normal. Id even down grade my wp back to 3.0.5 or something to get it back to the way it was.

    I am using permalink structure: /%post_id%/%postname%

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags