mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Check the correct global in get_page and also ensure that the cap check for deleting pages copes for the default page we edit when adding new. Fixes #11203.
git-svn-id: https://develop.svn.wordpress.org/trunk@12332 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -818,6 +818,14 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
$page_author_data = get_userdata( $page->post_author );
|
||||
//echo "current user id : $user_id, page author id: " . $page_author_data->ID . "<br />";
|
||||
// If the user is the author...
|
||||
|
||||
if ('' != $page->post_author) {
|
||||
$page_author_data = get_userdata( $page->post_author );
|
||||
} else {
|
||||
//No author set yet so default to current user for cap checks
|
||||
$page_author_data = $author_data;
|
||||
}
|
||||
|
||||
if ( $user_id == $page_author_data->ID ) {
|
||||
// If the page is published...
|
||||
if ( $page->post_status == 'publish' ) {
|
||||
|
||||
Reference in New Issue
Block a user