Changeset 47357
- Timestamp:
- 02/25/2020 12:48:11 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r47317 r47357 1510 1510 * registration, capability_type will always be a string of the singular value. 1511 1511 * 1512 * By default, sevenkeys are accepted as part of the capabilities array:1512 * By default, eight keys are accepted as part of the capabilities array: 1513 1513 * 1514 1514 * - edit_post, read_post, and delete_post are meta capabilities, which are then … … 1522 1522 * can be edited. If the post type does not support an author, then this will 1523 1523 * behave like edit_posts. 1524 * - delete_posts - Controls whether objects of this post type can be deleted. 1524 1525 * - publish_posts - Controls publishing objects of this post type. 1525 1526 * - read_private_posts - Controls whether private objects can be read. 1526 1527 * 1527 * These f ourprimitive capabilities are checked in core in various locations.1528 * There are also s evenother primitive capabilities which are not referenced1528 * These five primitive capabilities are checked in core in various locations. 1529 * There are also six other primitive capabilities which are not referenced 1529 1530 * directly in core, except in map_meta_cap(), which takes the three aforementioned 1530 1531 * meta capabilities and translates them into one or more primitive capabilities … … 1532 1533 * 1533 1534 * - read - Controls whether objects of this post type can be read. 1534 * - delete_posts - Controls whether objects of this post type can be deleted.1535 1535 * - delete_private_posts - Controls whether private objects can be deleted. 1536 1536 * - delete_published_posts - Controls whether published objects can be deleted. … … 1569 1569 'edit_posts' => 'edit_' . $plural_base, 1570 1570 'edit_others_posts' => 'edit_others_' . $plural_base, 1571 'delete_posts' => 'delete_' . $plural_base, 1571 1572 'publish_posts' => 'publish_' . $plural_base, 1572 1573 'read_private_posts' => 'read_private_' . $plural_base, … … 1577 1578 $default_capabilities_for_mapping = array( 1578 1579 'read' => 'read', 1579 'delete_posts' => 'delete_' . $plural_base,1580 1580 'delete_private_posts' => 'delete_private_' . $plural_base, 1581 1581 'delete_published_posts' => 'delete_published_' . $plural_base, -
trunk/tests/phpunit/tests/user/mapMetaCap.php
r46586 r47357 305 305 } 306 306 307 /** 308 * @ticket 30991 309 */ 310 function test_delete_posts_cap_without_map_meta_cap() { 311 register_post_type( 312 self::$post_type, 313 array( 314 'capability_type' => 'post', 315 'map_meta_cap' => false, 316 ) 317 ); 318 319 $post_type_object = get_post_type_object( self::$post_type ); 320 321 $this->assertFalse( $post_type_object->map_meta_cap ); 322 $this->assertEquals( 'delete_posts', $post_type_object->cap->delete_posts ); 323 } 324 307 325 function test_unfiltered_html_cap() { 308 326 if ( defined( 'DISALLOW_UNFILTERED_HTML' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.