From 5e198c07bf4cc4359537cc9e4ba8ebbf4967fff9 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Wed, 8 Dec 2010 15:59:56 +0000 Subject: [PATCH] Condense the logic. Props nacin. git-svn-id: https://develop.svn.wordpress.org/trunk@16799 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class-wp-xmlrpc-server.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index b8825febc7..c33368ac4e 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -2399,9 +2399,7 @@ class wp_xmlrpc_server extends IXR_Server { $page_template = ''; if ( !empty( $content_struct['post_type'] ) ) { if ( $content_struct['post_type'] == 'page' ) { - if ( $publish ) - $cap = 'publish_pages'; - elseif ('publish' == $content_struct['page_status']) + if ( $publish || 'publish' == $content_struct['page_status'] ) $cap = 'publish_pages'; else $cap = 'edit_pages'; @@ -2410,9 +2408,7 @@ class wp_xmlrpc_server extends IXR_Server { if ( !empty( $content_struct['wp_page_template'] ) ) $page_template = $content_struct['wp_page_template']; } elseif ( $content_struct['post_type'] == 'post' ) { - if ( $publish ) - $cap = 'publish_posts'; - elseif ('publish' == $content_struct['post_status']) + if ( $publish || 'publish' == $content_struct['post_status'] ) $cap = 'publish_posts'; else $cap = 'edit_posts'; @@ -2423,9 +2419,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 401, __( 'Invalid post type.' ) ); } } else { - if ( $publish ) - $cap = 'publish_posts'; - elseif ('publish' == $content_struct['post_status']) + if ( $publish || 'publish' == $content_struct['post_status'] ) $cap = 'publish_posts'; else $cap = 'edit_posts';