Created
May 7, 2012 00:32
-
-
Save jeremyfelt/2625156 to your computer and use it in GitHub Desktop.
The results of 'public' => true and 'public' => false in register_post_type()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* If public is not specified when registering a custom post type, false | |
* is used by default. */ | |
$non_public_pt_args = array( 'public' => false ); | |
/* The above is the same as specifying the following. */ | |
$non_public_pt_args = array( | |
'public' => false, | |
'publicly_queryable' => false, | |
'exclude_from_search' => true, | |
'show_ui' => false, | |
'show_in_nav_menus' => false, | |
); | |
/* Setting public to true results in a different set of values */ | |
$public_pt_args = array( 'public' => true ); | |
/* The above is the same asa specifying the following. */ | |
$public_pt_args = array( | |
'public' => true, | |
'publicly_queryable' => true, | |
'exclude_from_search' => false, | |
'show_ui' => true, | |
'show_in_nav_menus' => true, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment