Set show_ui to true for post and page. Exclude _builtin = true from areas where we need to special case builtin types. fixes #13403

git-svn-id: http://svn.automattic.com/wordpress/trunk@14713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-05-17 16:39:36 +00:00
parent 72d07941c7
commit f0076eed1c
5 changed files with 4 additions and 7 deletions

View File

@ -11,7 +11,7 @@ require_once('./admin.php');
if ( !isset($_GET['post_type']) ) if ( !isset($_GET['post_type']) )
$post_type = 'post'; $post_type = 'post';
elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) || in_array( $_GET['post_type'], array( 'post', 'page' ) ) ) elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) )
$post_type = $_GET['post_type']; $post_type = $_GET['post_type'];
else else
wp_die( __('Invalid post type') ); wp_die( __('Invalid post type') );

View File

@ -3708,7 +3708,7 @@ function screen_layout($screen) {
if ( is_string($screen) ) if ( is_string($screen) )
$screen = convert_to_screen($screen); $screen = convert_to_screen($screen);
$columns = array('dashboard' => 4, 'post' => 2, 'page' => 2, 'link' => 2); $columns = array('dashboard' => 4, 'link' => 2);
// Add custom post types // Add custom post types
foreach ( get_post_types( array('show_ui' => true) ) as $post_type ) foreach ( get_post_types( array('show_ui' => true) ) as $post_type )

View File

@ -113,7 +113,7 @@ $menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='c
$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group $_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group
foreach ( (array) get_post_types( array('show_ui' => true) ) as $ptype ) { foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false) ) as $ptype ) {
$ptype_obj = get_post_type_object( $ptype ); $ptype_obj = get_post_type_object( $ptype );
$ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : $_wp_last_object_menu++; // If we're to use $_wp_last_object_menu, increment it first. $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : $_wp_last_object_menu++; // If we're to use $_wp_last_object_menu, increment it first.
$ptype_for_id = sanitize_html_class( $ptype ); $ptype_for_id = sanitize_html_class( $ptype );

View File

@ -11,7 +11,7 @@ require_once('./admin.php');
if ( !isset($_GET['post_type']) ) if ( !isset($_GET['post_type']) )
$post_type = 'post'; $post_type = 'post';
elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) || in_array( $_GET['post_type'], array( 'post', 'page' ) ) ) elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) )
$post_type = $_GET['post_type']; $post_type = $_GET['post_type'];
else else
wp_die( __('Invalid post type') ); wp_die( __('Invalid post type') );

View File

@ -17,7 +17,6 @@
function create_initial_post_types() { function create_initial_post_types() {
register_post_type( 'post', array( register_post_type( 'post', array(
'public' => true, 'public' => true,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */ '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */ '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post', 'capability_type' => 'post',
@ -29,7 +28,6 @@ function create_initial_post_types() {
register_post_type( 'page', array( register_post_type( 'page', array(
'public' => true, 'public' => true,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */ '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */ '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'page', 'capability_type' => 'page',
@ -74,7 +72,6 @@ function create_initial_post_types() {
'singular_name' => __( 'Navigation Menu Item' ), 'singular_name' => __( 'Navigation Menu Item' ),
), ),
'public' => false, 'public' => false,
'show_ui' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */ '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post', 'capability_type' => 'post',
'hierarchical' => false, 'hierarchical' => false,