Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    This has been the case since, I believe, version 1.3.0, for what it’s worth.

    From a different thread a day or two ago:

    I imagine you could have the URLs be just fine and as intended using the rewrite slug field, which doesn't get the same conversion behavior.

    and

    From the following codex page
    https://codex.wordpress.org/Function_Reference/register_post_type
    
    Also, if the post type contains dashes you will not be able to add columns to the custom post type's admin page (using the 'manage_<Custom Post Type Name>_posts_columns' action).
    
    May not be the biggest blocker for some, but at the same time we try to make smart choices for the users.
    
    I also stand by the point I made previously about using the rewrite slug to alter how they appear in the rewrite rules/urls while still using the underscore for the slug itself.

    Original thread: https://wordpress.org/support/topic/cannot-use-dashes-as-post-type-slug?replies=5

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Followup, that I also just added to the thread linked at the end of my first reply. Is this an issue where you had the post types created before you updated to the latest version, and we’re now breaking things because of the swapping out of dashes?

    Thread Starter paulaxongarside

    (@paulaxongarside)

    Hi Michael

    No this is a new project, I dare not go near the other live projects because that would be a massive headache!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Some thoughts regarding this.

    1. The rewrite slug is a perfectly valid way to have the post type have a dash instead of a slug, for URL sake, while still using an underscore for the internal post type.

    2. If it happened to be an already-created post type with CPTUI, I found that when keyboard tabbing through the screen, it triggered the convert, but selecting the first input with the mouse did nothing to it. I consider that a bug and will be addressing it. Otherwise people shouldn’t be touching that field unless they absolutely intend to change the post type to something else anyway.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘I can't use hyphens/dashes?’ is closed to new replies.