Skip to content

Instantly share code, notes, and snippets.

@stompweb
Last active November 4, 2015 19:40
Show Gist options
  • Save stompweb/f6d0fad3960dd019c684 to your computer and use it in GitHub Desktop.
Save stompweb/f6d0fad3960dd019c684 to your computer and use it in GitHub Desktop.
WP adds -2 to end of slugs with just numbers in the title of hierarchical CPTs

Steps

  1. Create a hierarchical post type
  2. Add a post under that post type called '1990'
  3. Slug is created with -2 on the end even if a similar post doesn't already exist i.e. 1990-2

Doesn't happen for non-hierarchical post types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment