mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Posts, Post Types: Ensure delete_posts is included in default post type capabilities regardless of map_meta_cap value.
This resolves PHP notices in a few places in core where this capability is checked. Props Mte90, johnbillion, dipesh.kakadiya, jipmoors, bamadesigner, dd32, johnjamesjacoby, xedin.unknown, flixos90, SergeyBiryukov. Fixes #30991. git-svn-id: https://develop.svn.wordpress.org/trunk@47357 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -304,6 +304,24 @@ class Tests_User_MapMetaCap extends WP_UnitTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 30991
|
||||
*/
|
||||
function test_delete_posts_cap_without_map_meta_cap() {
|
||||
register_post_type(
|
||||
self::$post_type,
|
||||
array(
|
||||
'capability_type' => 'post',
|
||||
'map_meta_cap' => false,
|
||||
)
|
||||
);
|
||||
|
||||
$post_type_object = get_post_type_object( self::$post_type );
|
||||
|
||||
$this->assertFalse( $post_type_object->map_meta_cap );
|
||||
$this->assertEquals( 'delete_posts', $post_type_object->cap->delete_posts );
|
||||
}
|
||||
|
||||
function test_unfiltered_html_cap() {
|
||||
if ( defined( 'DISALLOW_UNFILTERED_HTML' ) ) {
|
||||
$this->assertFalse( DISALLOW_UNFILTERED_HTML );
|
||||
|
||||
Reference in New Issue
Block a user