Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've got a weird problem that's very similar to this one: Why does Wordpress Pagination Remove the Spaces from my GET Variable?. Except that mine isn't withn search results pages--it's with custom taxonomy pages.

Here's the problem: clean WP install with no plugins. I add a custom taxonomy like so in my functions file:

register_taxonomy(
    'my-categories',
    array(
        'post',
    ),
    array(
        'hierarchical' => true,
        'label' => 'My Categories',
        'query_var' => true,
        'rewrite' => array( 'slug' => 'my-categories' ),
    )
);

I've created a term in this taxonomy called "test one". If I go to the taxonomy page and add a custom var to the query string, everything seems fine (like so: /my-categories/test-one/?something=one+two).

Here's where it gets weird: if I add in some pagination vars (manually changing the URL to /my-categories/test-one/page/2/?something=one+two), the resulting page actually rewrites my URL, stripping out spaces from the custom var (the resulting URL is /my-categories/test-one/page/2/?something=onetwo).

Adding my custom var to the vars list using the query_vars filter has no effect.

There is obviously a bad rewrite happening somewhere in the WordPress core (I assume in the register_taxonomy() function?), but I don't know enough about WP's rewriting API to figure out what it is. Anybody have any ideas?

I'll file an issue in Trac if it is indeed a bug, but I need to know how to patch it short-term.

share|improve this question
    
Did you ever find a solution to this issue? –  samb Mar 2 '12 at 18:26
    
It was a bug that needed a patch. My ticket has been marked as closed in Trac, and it looks like the patch made it into 3.3, so an update should fix it for you? core.trac.wordpress.org/ticket/18086 –  MathSmath Mar 5 '12 at 15:20
add comment

1 Answer 1

up vote 0 down vote accepted

I'm answering this just so it doesn't stay in the unanswered list.

This was a core bug that has been patched in 3.3.

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.