Changeset 12993 for trunk/wp-includes/post.php
- Timestamp:
- 02/06/2010 05:27:30 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.