Make WordPress Core


Ignore:
Timestamp:
08/26/2016 06:22:28 PM (8 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r37924 r38378  
    6666                break;
    6767            }
     68        }
     69
     70        if ( ( get_option( 'page_for_posts' ) == $post->ID ) || ( get_option( 'page_on_front' ) == $post->ID ) ) {
     71            $caps[] = 'manage_options';
     72            break;
    6873        }
    6974
Note: See TracChangeset for help on using the changeset viewer.