Changeset 12927 for trunk/wp-includes/post.php
- Timestamp:
- 02/02/2010 05:37:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r12923 r12927 701 701 * inherit_type - The post type from which to inherit the edit link and capability type. Defaults to none. 702 702 * capability_type - The post type to use for checking read, edit, and delete capabilities. Defaults to "post". 703 * edit_cap - The capability that controls editing a particular object of this post type. Defaults to "edit_$capability_type" (edit_post). 704 * edit_type_cap - The capability that controls editing objects of this post type as a class. Defaults to "edit_ . $capability_type . s" (edit_posts). 705 * edit_others_cap - The capability that controls editing objects of this post type that are owned by other users. Defaults to "edit_others_ . $capability_type . s" (edit_others_posts). 706 * edit_others_cap - The capability that controls publishing objects of this post type. Defaults to "publish_ . $capability_type . s" (publish_posts). 707 * read_cap - The capability that controls reading a particular object of this post type. Defaults to "read_$capability_type" (read_post). 708 * delete_cap - The capability that controls deleting a particular object of this post type. Defaults to "delete_$capability_type" (delete_post). 703 709 * hierarchical - Whether the post type is hierarchical. Defaults to false. 704 710 * supports - An alias for calling add_post_type_support() directly. See add_post_type_support() for Documentation. Defaults to none. … … 737 743 $args->label = $post_type; 738 744 739 if ( empty($args->capability_type) ) { 740 $args->edit_cap = ''; 741 $args->read_cap = ''; 742 $args->delete_cap = ''; 743 } else { 745 if ( empty($args->capability_type) ) 746 $args->capability_type = 'post'; 747 if ( empty($args->edit_cap) ) 744 748 $args->edit_cap = 'edit_' . $args->capability_type; 749 if ( empty($args->edit_type_cap) ) 750 $args->edit_type_cap = 'edit_' . $args->capability_type . 's'; 751 if ( empty($args->edit_others_cap) ) 752 $args->edit_others_cap = 'edit_others_' . $args->capability_type . 's'; 753 if ( empty($args->publish_cap) ) 754 $args->publish_cap = 'publish_' . $args->capability_type . 's'; 755 if ( empty($args->read_cap) ) 745 756 $args->read_cap = 'read_' . $args->capability_type; 757 if ( empty($args->delete_cap) ) 746 758 $args->delete_cap = 'delete_' . $args->capability_type; 747 }748 759 749 760 if ( !$args->_builtin && $args->public )
Note: See TracChangeset
for help on using the changeset viewer.