mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Role/Capability: Only users who can manage options should be able to trash/delete the page for posts or the front page, as they are the only users who can restore it or subsequently alter the "Front page displays" setting.
Fixes #37580 Props JakePT git-svn-id: https://develop.svn.wordpress.org/trunk@38378 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -67,6 +67,11 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( get_option( 'page_for_posts' ) == $post->ID ) || ( get_option( 'page_on_front' ) == $post->ID ) ) {
|
||||
$caps[] = 'manage_options';
|
||||
break;
|
||||
}
|
||||
|
||||
$post_type = get_post_type_object( $post->post_type );
|
||||
if ( ! $post_type ) {
|
||||
/* translators: 1: post type, 2: capability name */
|
||||
|
||||
Reference in New Issue
Block a user