Skip to content

Instantly share code, notes, and snippets.

@c10b10
Forked from jeremyfelt/gist:2625350
Last active December 11, 2015 15:29
Show Gist options
  • Save c10b10/4621171 to your computer and use it in GitHub Desktop.
Save c10b10/4621171 to your computer and use it in GitHub Desktop.
Post type argument test results
'rewrite' => true
'public' => true 'publicly_queryable' => true /cpt-slug/cpt-post-slug Loads fine
'public' => false 'publicly_queryable' => true /cpt-slug/cpt-post-slug Loads fine
'public' => true 'publicly_queryable' => false /cpt-slug/cpt-post-slug 404 Error
'public' => false 'publicly_queryable' => true /cpt-slug-cpt-post-slug 404 Error
'rewrite' => false
'public' => true 'publicly_queryable' => true /?cpt-slug=cpt-post-slug Loads fine
'public' => true 'publicly_queryable' => true /?p=ID&post_type=cpt-slug Loads fine
'public' => false 'publicly_queryable' => true /?cpt-slug=cpt-post-slug Loads fine
'public' => false 'publicly_queryable' => true /?p=ID&post_type=cpt-slug Loads fine
'public' => true 'publicly_queryable' => false /?cpt-slug=cpt-post-slug 404 Error
'public' => false 'publicly_queryable' => false /?cpt-slug=cpt-post-slug 404 Error
'public' => true 'publicly_queryable' => false /?p=ID&post_type=cpt-slug 404 Error
'public' => false 'publicly_queryable' => false /?p=ID&post_type=cpt-slug 404 Error
'has_archive' => true
'public' => true 'publicly_queryable' => true /cpt-slug/ Loads archive page
'public' => false 'publicly_queryable' => true /cpt-slug/ Loads archive page
'public' => true 'publicly_queryable' => false /cpt-slug/ No archive page
'public' => false 'publicly_queryable' => false /cpt-slug/ No archive page
'has_archive' => false
'public' => true 'publicly_queryable' => true /?post_type=cpt-slug Loads fine
'public' => true 'publicly_queryable' => false /?post_type=cpt-slug Loads index
'public' => false 'publicly_queryable' => true /?post_type=cpt-slug Loads fine
'public' => false 'publicly_queryable' => false /?post_type=cpt-slug Loads index
'exclude_from_search' => false
'public' => true 'publicly_queryable' => true /?s=search-term Results show from all post types
'public' => false 'publicly_queryable' => true /?s=search-term Results show from all post types
'public' => true 'publicly_queryable' => true /?s=search-term&post_type=cpt-slug Result shows only one post type
'public' => false 'publicly_queryable' => true /?s=search-term&post_type=cpt-slug Result shows only one post type
'public' => true 'publicly_queryable' => false /?s=search-term Results show from all post types
'public' => false 'publicly_queryable' => false /?s=search-term Results show from all post types
'public' => true 'publicly_queryable' => false /?s=search-term&post_type=cpt-slug Result shows results from all post types WRONG
'public' => false 'publicly_queryable' => false /?s=search-term&post_type=cpt-slug Result shows results from all post types WRONG
'exclude_from_search' => true
'public' => true 'publicly_queryable' => true /?s=search-term Only results from other post types
'public' => false 'publicly_queryable' => true /?s=search-term Only results from other post types
'public' => true 'publicly_queryable' => true /?s=search-term&post_type=cpt-slug Results show from this post type WRONG
'public' => false 'publicly_queryable' => true /?s=search-term&post_type=cpt-slug Results show from this post type WRONG
'public' => true 'publicly_queryable' => false /?s=search-term Only results from other post types
'public' => false 'publicly_queryable' => false /?s=search-term Only results from other post types
'public' => true 'publicly_queryable' => false /?s=search-term&post_type=cpt-slug Results from all other post types WRONG
'public' => false 'publicly_queryable' => false /?s=search-term&post_type=cpt-slug Results from all other post types WRONG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment