Changeset 12993
- Timestamp:
- 02/06/2010 05:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit.php
r12927 r12993 21 21 } 22 22 23 if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array(' _show' => true ) ) ) || in_array( $_GET['post_type'], get_post_types( array('_builtin' => true ) ) ) ) )23 if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) ) 24 24 $post_type = $_GET['post_type']; 25 25 else -
trunk/wp-admin/menu.php
r12984 r12993 82 82 $_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group 83 83 84 foreach ( (array) get_post_types( array(' _show' => true) ) as $ptype ) {84 foreach ( (array) get_post_types( array('show_ui' => true) ) as $ptype ) { 85 85 $_wp_last_object_menu++; 86 86 $ptype_obj = get_post_type_object($ptype); 87 $menu[$_wp_last_object_menu] = array(esc_attr($ptype_obj->label), 'edit_' . $ptype_obj->capability_type . 's', "edit.php?post_type=$ptype", '', 'menu-top', 'menu-posts', 'div');87 $menu[$_wp_last_object_menu] = array(esc_attr($ptype_obj->label), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top', 'menu-posts', 'div'); 88 88 $submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), 'edit_posts', "edit.php?post_type=$ptype"); 89 89 /* translators: add new custom post type */ -
trunk/wp-admin/post-new.php
r12987 r12993 10 10 require_once('admin.php'); 11 11 12 if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array(' _show' => true ) ) ) || in_array( $_GET['post_type'], get_post_types( array('_builtin' => true ) ) ) ) )12 if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) ) 13 13 $post_type = $_GET['post_type']; 14 14 else -
trunk/wp-includes/post.php
r12992 r12993 17 17 function create_initial_post_types() { 18 18 register_post_type( 'post', array( 'label' => __('Posts'), 19 'public ly_queryable' => true,20 ' exclude_from_search' => false,19 'public' => true, 20 'show_ui' => false, 21 21 '_builtin' => true, 22 22 '_edit_link' => 'post.php?post=%d', … … 29 29 30 30 register_post_type( 'page', array( 'label' => __('Pages'), 31 'public ly_queryable' => true,32 ' exclude_from_search' => false,31 'public' => true, 32 'show_ui' => false, 33 33 '_builtin' => true, 34 34 '_edit_link' => 'post.php?post=%d', … … 41 41 42 42 register_post_type( 'attachment', array('label' => __('Media'), 43 'exclude_from_search' => false, 43 'public' => true, 44 'show_ui' => false, 44 45 '_builtin' => true, 45 46 '_edit_link' => 'media.php?attachment_id=%d', … … 51 52 52 53 register_post_type( 'revision', array( 'label' => __('Revisions'), 53 ' exclude_from_search' => true,54 'public' => false, 54 55 '_builtin' => true, 55 56 '_edit_link' => 'revision.php?revision=%d', … … 705 706 * exclude_from_search - Whether to exclude posts with this post type from search results. Defaults to true if the type is not public, false if the type is public. 706 707 * publicly_queryable - Whether post_type queries can be performed from the front page. Defaults to whatever public is set as. 708 * show_ui - Whether to generate a default UI for managing this post type. Defaults to true if the type is public, false if the type is not public. 707 709 * inherit_type - The post type from which to inherit the edit link and capability type. Defaults to none. 708 710 * capability_type - The post type to use for checking read, edit, and delete capabilities. Defaults to "post". … … 733 735 734 736 // Args prefixed with an underscore are reserved for internal use. 735 $defaults = array('label' => false, 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, ' _show' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array());737 $defaults = array('label' => false, 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null ); 736 738 $args = wp_parse_args($args, $defaults); 737 739 $args = (object) $args; … … 743 745 if ( null === $args->publicly_queryable ) 744 746 $args->publicly_queryable = $args->public; 747 748 // If not set, default to the setting for public. 749 if ( null === $args->show_ui ) 750 $args->show_ui = $args->public; 745 751 746 752 // If not set, default to true if not public, false if public. … … 765 771 if ( empty($args->delete_cap) ) 766 772 $args->delete_cap = 'delete_' . $args->capability_type; 767 768 if ( !$args->_builtin && $args->public )769 $args->_show = true;770 773 771 774 if ( ! empty($args->supports) ) {
Note: See TracChangeset
for help on using the changeset viewer.