• Hi there, I started noticing some strange behavior with the generation of category slugs. I can repeat the issue consistently. Perhaps I’m doing something wrong.

    I’m dealing with a heirarchical category relationship and trying to edit the slugs and noticed inconsistent results, every save.

    Parent-child-child2

    Property Types
    -LEED
    – -County

    If I edit the slug of child 2 category name = “County” using the category editor. Delete the slug and save so an auto generated slug is created I get result #1 for slug, if I edit the same category again, delete slug and save I get result #2 for slug.

    #1 edit of category “County”
    Parent = property types
    child = leed
    child2 = county-leed-property-types (auto generated slug pulls both parent and grandparent names into the slug)

    #2 edit of category
    Parent = property types
    child = leed
    child2 = county-leed (auto generated slug pulls only parent)

    #3 edit of category
    Parent = property types
    child = leed
    child2 = county-leed-property-types (auto generated slug)

    #4 edit of category
    Parent = property types
    child = leed
    child2 = county-leed (auto generated slug)

    The results repeat this way, each time saving the alternate slug.

Viewing 1 replies (of 1 total)
  • Hi there,

    I’m testing this out on a couple of installations. The default behavior of WordPress is to generate a slug based on each item without including any ancestors. So what it should look like is:

    Parent: property-types
    Child: leed
    Child 2: county

    The exception would be if the slug is already in use for another term, in which case WP would most likely add a number (so, leed2 if leed is already in use).

    I suspect that the default behavior is being changed by a plugin on your site (or possibly even the theme if it contains custom types or similar modifications). Look over the plugins you have activated. You can try deactivating them one at a time and doing this test again. Ultimately if it turns out to be something not in core, then you’ll probably need to notify that plugin (or theme) developer and report the problem.

Viewing 1 replies (of 1 total)
  • The topic ‘Category Slug – inconsistent name creation’ is closed to new replies.