Home > Support > Forum

Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Sanitization for $taxonomy->name

UserPost

11:57 pm
July 22, 2010


mfields

Member

Portland, OR

posts 3

1

Hi.

I was working on a project today where my client had this plugin installed but it was not functioning correctly with one of my plugins. While I was debugging this problem I discovered a bug in my plugin as well as one in the Custom Post Type UI plugin. The value for “Name” on the “Manage Custom Taxonomies” screen is not being propper filtered through sanitize_title_with_dashes(). This can cause trouble with rewritten urls for term views. Here's how you can recreate:

1. Set up a new post taxonomy with the following value for Taxonomy Name: “My Taxonomy with Spaces”.
2. Add some terms to the taxonomy and associate a few of these terms to a post.
3. Add the following code to your template file that displays single posts:

<div>
<?php wp_tag_cloud( array(
    'orderby' => 'name',
    'taxonomy' => 'My Taxonomy with Spaces'
    ) ); ?>
</div>

4. When any of the links are clicked, a 404 is generated.

The url looks like:
http://localhost/r/MyTaxonomyw…..term-name/

instead of:
http://localhost/r/my-taxonomy…..term-name/

Hope this helps!
-Mike

Search 


If you can dream it, we can build it! Please contact us today to discuss your ideas and how WebDevStudios can help you today!