X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/4feeb71a9d812a9ae371c28a3d8b442a4394ded7..607b7e02d77e7326161e8ec15639052d2040f745:/wp-includes/class-wp-xmlrpc-server.php diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 531dd50c..be2d3edb 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -14,7 +14,7 @@ * options, etc. * * As of WordPress 3.5.0, XML-RPC is enabled by default. It can be disabled - * via the xmlrpc_enabled filter found in wp_xmlrpc_server::login(). + * via the {@see 'xmlrpc_enabled'} filter found in wp_xmlrpc_server::login(). * * @package WordPress * @subpackage Publishing @@ -54,11 +54,11 @@ class wp_xmlrpc_server extends IXR_Server { protected $auth_failed = false; /** - * Register all of the XMLRPC methods that XMLRPC server understands. + * Registers all of the XMLRPC methods that XMLRPC server understands. * * Sets up server and method property. Passes XMLRPC - * methods through the 'xmlrpc_methods' filter to allow plugins to extend - * or replace XMLRPC methods. + * methods through the {@see 'xmlrpc_methods'} filter to allow plugins to extend + * or replace XML-RPC methods. * * @since 1.5.0 */ @@ -159,7 +159,7 @@ class wp_xmlrpc_server extends IXR_Server { $this->initialise_blog_option_info(); /** - * Filter the methods exposed by the XML-RPC server. + * Filters the methods exposed by the XML-RPC server. * * This filter can be used to add new methods, and remove built-in methods. * @@ -171,7 +171,7 @@ class wp_xmlrpc_server extends IXR_Server { } /** - * Make private/protected methods readable for backwards compatibility. + * Make private/protected methods readable for backward compatibility. * * @since 4.0.0 * @access public @@ -247,7 +247,7 @@ class wp_xmlrpc_server extends IXR_Server { } /** - * Filter whether XML-RPC methods requiring authentication are enabled. + * Filters whether XML-RPC methods requiring authentication are enabled. * * Contrary to the way it's named, this filter does not control whether XML-RPC is *fully* * enabled, rather, it only controls whether XML-RPC methods requiring authentication - such @@ -288,7 +288,7 @@ class wp_xmlrpc_server extends IXR_Server { $this->auth_failed = true; /** - * Filter the XML-RPC user login error message. + * Filters the XML-RPC user login error message. * * @since 3.5.0 * @@ -562,7 +562,7 @@ class wp_xmlrpc_server extends IXR_Server { ); /** - * Filter the XML-RPC blog options property. + * Filters the XML-RPC blog options property. * * @since 2.6.0 * @@ -704,7 +704,7 @@ class wp_xmlrpc_server extends IXR_Server { $_taxonomy['object_type'] = array_unique( (array) $taxonomy->object_type ); /** - * Filter XML-RPC-prepared data for the given taxonomy. + * Filters XML-RPC-prepared data for the given taxonomy. * * @since 3.4.0 * @@ -738,7 +738,7 @@ class wp_xmlrpc_server extends IXR_Server { $_term['count'] = intval( $_term['count'] ); /** - * Filter XML-RPC-prepared data for the given term. + * Filters XML-RPC-prepared data for the given term. * * @since 3.4.0 * @@ -867,7 +867,7 @@ class wp_xmlrpc_server extends IXR_Server { } /** - * Filter XML-RPC-prepared date for the given post. + * Filters XML-RPC-prepared date for the given post. * * @since 3.4.0 * @@ -881,10 +881,12 @@ class wp_xmlrpc_server extends IXR_Server { /** * Prepares post data for return in an XML-RPC object. * + * @since 3.4.0 + * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * @access protected * - * @param object $post_type Post type object. - * @param array $fields The subset of post fields to return. + * @param WP_Post_Type $post_type Post type object. + * @param array $fields The subset of post fields to return. * @return array The prepared post type data. */ protected function _prepare_post_type( $post_type, $fields ) { @@ -918,12 +920,13 @@ class wp_xmlrpc_server extends IXR_Server { $_post_type['taxonomies'] = get_object_taxonomies( $post_type->name, 'names' ); /** - * Filter XML-RPC-prepared date for the given post type. + * Filters XML-RPC-prepared date for the given post type. * * @since 3.4.0 + * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * - * @param array $_post_type An array of post type data. - * @param object $post_type Post type object. + * @param array $_post_type An array of post type data. + * @param WP_Post_Type $post_type Post type object. */ return apply_filters( 'xmlrpc_prepare_post_type', $_post_type, $post_type ); } @@ -957,7 +960,7 @@ class wp_xmlrpc_server extends IXR_Server { $_media_item['thumbnail'] = $_media_item['link']; /** - * Filter XML-RPC-prepared data for the given media item. + * Filters XML-RPC-prepared data for the given media item. * * @since 3.4.0 * @@ -1039,7 +1042,7 @@ class wp_xmlrpc_server extends IXR_Server { ); /** - * Filter XML-RPC-prepared data for the given page. + * Filters XML-RPC-prepared data for the given page. * * @since 3.4.0 * @@ -1088,7 +1091,7 @@ class wp_xmlrpc_server extends IXR_Server { ); /** - * Filter XML-RPC-prepared data for the given comment. + * Filters XML-RPC-prepared data for the given comment. * * @since 3.4.0 * @@ -1136,7 +1139,7 @@ class wp_xmlrpc_server extends IXR_Server { } /** - * Filter XML-RPC-prepared data for the given user. + * Filters XML-RPC-prepared data for the given user. * * @since 3.5.0 * @@ -1152,7 +1155,7 @@ class wp_xmlrpc_server extends IXR_Server { * * @since 3.4.0 * - * @link http://en.wikipedia.org/wiki/RSS_enclosure for information on RSS enclosures. + * @link https://en.wikipedia.org/wiki/RSS_enclosure for information on RSS enclosures. * * @param array $args { * Method arguments. Note: top-level arguments must be ordered as documented. @@ -1299,7 +1302,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_type = get_post_type_object( $post_data['post_type'] ); if ( ! $post_type ) - return new IXR_Error( 403, __( 'Invalid post type' ) ); + return new IXR_Error( 403, __( 'Invalid post type.' ) ); $update = ! empty( $post_data['ID'] ); @@ -1340,7 +1343,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_data['post_author'] = absint( $post_data['post_author'] ); if ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) { if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) - return new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) ); $author = get_userdata( $post_data['post_author'] ); @@ -1423,7 +1426,7 @@ class wp_xmlrpc_server extends IXR_Server { $term = get_term_by( 'id', $term_id, $taxonomy ); if ( ! $term ) - return new IXR_Error( 403, __( 'Invalid term ID' ) ); + return new IXR_Error( 403, __( 'Invalid term ID.' ) ); $terms[$taxonomy][] = (int) $term_id; } @@ -1506,7 +1509,7 @@ class wp_xmlrpc_server extends IXR_Server { $this->attach_uploads( $post_ID, $post_data['post_content'] ); /** - * Filter post data array to be inserted via XML-RPC. + * Filters post data array to be inserted via XML-RPC. * * @since 3.4.0 * @@ -1634,7 +1637,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! current_user_can( 'delete_post', $post_id ) ) { - return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) ); } $result = wp_delete_post( $post_id ); @@ -1709,7 +1712,7 @@ class wp_xmlrpc_server extends IXR_Server { $fields = $args[4]; } else { /** - * Filter the list of post query fields used by the given XML-RPC method. + * Filters the list of post query fields used by the given XML-RPC method. * * @since 3.4.0 * @@ -1731,7 +1734,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 404, __( 'Invalid post ID.' ) ); if ( ! current_user_can( 'edit_post', $post_id ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); return $this->_prepare_post( $post, $fields ); } @@ -1792,7 +1795,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! current_user_can( $post_type->cap->edit_posts ) ) - return new IXR_Error( 401, __( 'You are not allowed to edit posts in this post type.' )); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' )); $query['post_type'] = $post_type->name; @@ -1870,12 +1873,12 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.newTerm' ); if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) - return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); + return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); $taxonomy = get_taxonomy( $content_struct['taxonomy'] ); if ( ! current_user_can( $taxonomy->cap->manage_terms ) ) - return new IXR_Error( 401, __( 'You are not allowed to create terms in this taxonomy.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) ); $taxonomy = (array) $taxonomy; @@ -1957,12 +1960,12 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.editTerm' ); if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) - return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); + return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); $taxonomy = get_taxonomy( $content_struct['taxonomy'] ); if ( ! current_user_can( $taxonomy->cap->edit_terms ) ) - return new IXR_Error( 401, __( 'You are not allowed to edit terms in this taxonomy.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) ); $taxonomy = (array) $taxonomy; @@ -1975,7 +1978,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 500, $term->get_error_message() ); if ( ! $term ) - return new IXR_Error( 404, __( 'Invalid term ID' ) ); + return new IXR_Error( 404, __( 'Invalid term ID.' ) ); if ( isset( $content_struct['name'] ) ) { $term_data['name'] = trim( $content_struct['name'] ); @@ -2053,12 +2056,12 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.deleteTerm' ); if ( ! taxonomy_exists( $taxonomy ) ) - return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); + return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); $taxonomy = get_taxonomy( $taxonomy ); if ( ! current_user_can( $taxonomy->cap->delete_terms ) ) - return new IXR_Error( 401, __( 'You are not allowed to delete terms in this taxonomy.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete terms in this taxonomy.' ) ); $term = get_term( $term_id, $taxonomy->name ); @@ -2066,7 +2069,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 500, $term->get_error_message() ); if ( ! $term ) - return new IXR_Error( 404, __( 'Invalid term ID' ) ); + return new IXR_Error( 404, __( 'Invalid term ID.' ) ); $result = wp_delete_term( $term_id, $taxonomy->name ); @@ -2124,12 +2127,12 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.getTerm' ); if ( ! taxonomy_exists( $taxonomy ) ) - return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); + return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); $taxonomy = get_taxonomy( $taxonomy ); if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) - return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) ); $term = get_term( $term_id , $taxonomy->name, ARRAY_A ); @@ -2137,7 +2140,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 500, $term->get_error_message() ); if ( ! $term ) - return new IXR_Error( 404, __( 'Invalid term ID' ) ); + return new IXR_Error( 404, __( 'Invalid term ID.' ) ); return $this->_prepare_term( $term ); } @@ -2182,12 +2185,12 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.getTerms' ); if ( ! taxonomy_exists( $taxonomy ) ) - return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); + return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); $taxonomy = get_taxonomy( $taxonomy ); if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) - return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) ); $query = array(); @@ -2260,7 +2263,7 @@ class wp_xmlrpc_server extends IXR_Server { $fields = $args[4]; } else { /** - * Filter the taxonomy query fields used by the given XML-RPC method. + * Filters the taxonomy query fields used by the given XML-RPC method. * * @since 3.4.0 * @@ -2277,12 +2280,12 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.getTaxonomy' ); if ( ! taxonomy_exists( $taxonomy ) ) - return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); + return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); $taxonomy = get_taxonomy( $taxonomy ); if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) - return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) ); return $this->_prepare_taxonomy( $taxonomy, $fields ); } @@ -2395,7 +2398,7 @@ class wp_xmlrpc_server extends IXR_Server { $fields = $args[4]; } else { /** - * Filter the default user query fields used by the given XML-RPC method. + * Filters the default user query fields used by the given XML-RPC method. * * @since 3.5.0 * @@ -2412,7 +2415,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.getUser' ); if ( ! current_user_can( 'edit_user', $user_id ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit users.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this user.' ) ); $user_data = get_userdata( $user_id ); @@ -2470,7 +2473,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.getUsers' ); if ( ! current_user_can( 'list_users' ) ) - return new IXR_Error( 401, __( 'You are not allowed to browse users.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to browse users.' ) ); $query = array( 'fields' => 'all_with_meta' ); @@ -2543,7 +2546,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.getProfile' ); if ( ! current_user_can( 'edit_user', $user->ID ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit your profile.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) ); $user_data = get_userdata( $user->ID ); @@ -2589,7 +2592,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.editProfile' ); if ( ! current_user_can( 'edit_user', $user->ID ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit your profile.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) ); // holds data of the user $user_data = array(); @@ -2659,7 +2662,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 404, __( 'Invalid post ID.' ) ); if ( !current_user_can( 'edit_page', $page_id ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit this page.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.getPage' ); @@ -2700,7 +2703,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'edit_pages' ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.getPages' ); @@ -2794,7 +2797,7 @@ class wp_xmlrpc_server extends IXR_Server { // Make sure the user can delete pages. if ( !current_user_can('delete_page', $page_id) ) - return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete this page.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this page.' ) ); // Attempt to delete the page. $result = wp_delete_post($page_id); @@ -2856,7 +2859,7 @@ class wp_xmlrpc_server extends IXR_Server { // Make sure the user is allowed to edit pages. if ( !current_user_can('edit_page', $page_id) ) - return new IXR_Error( 401, __( 'Sorry, you do not have the right to edit this page.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) ); // Mark this as content for a page. $content['post_type'] = 'page'; @@ -2902,7 +2905,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'edit_pages' ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.getPageList' ); @@ -2958,7 +2961,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can('edit_posts') ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.getAuthors' ); @@ -3053,7 +3056,7 @@ class wp_xmlrpc_server extends IXR_Server { // Make sure the user is allowed to add a category. if ( !current_user_can('manage_categories') ) - return new IXR_Error(401, __('Sorry, you do not have the right to add a category.')); + return new IXR_Error(401, __('Sorry, you are not allowed to add a category.')); // If no slug was provided make it empty so that // WordPress will generate one. @@ -3112,7 +3115,7 @@ class wp_xmlrpc_server extends IXR_Server { * @type string $password * @type int $category_id * } - * @return bool|IXR_Error See {@link wp_delete_term()} for return info. + * @return bool|IXR_Error See wp_delete_term() for return info. */ public function wp_deleteCategory( $args ) { $this->escape( $args ); @@ -3128,7 +3131,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.deleteCategory' ); if ( !current_user_can('manage_categories') ) - return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete a category.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete a category.' ) ); $status = wp_delete_term( $category_id, 'category' ); @@ -3226,7 +3229,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! current_user_can( 'edit_comment', $comment_id ) ) { - return new IXR_Error( 403, __( 'You are not allowed to moderate or edit this comment.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) ); } return $this->_prepare_comment( $comment ); @@ -3244,7 +3247,7 @@ class wp_xmlrpc_server extends IXR_Server { * - 'status' - Default is ''. Filter by status (e.g., 'approve', 'hold') * - 'post_id' - Default is ''. The post where the comment is posted. Empty string shows all comments. * - 'number' - Default is 10. Total number of media items to retrieve. - * - 'offset' - Default is 0. See {@link WP_Query::query()} for more. + * - 'offset' - Default is 0. See WP_Query::query() for more. * * @since 2.7.0 * @@ -3256,7 +3259,7 @@ class wp_xmlrpc_server extends IXR_Server { * @type string $password * @type array $struct * } - * @return array|IXR_Error Contains a collection of comments. See {@link wp_xmlrpc_server::wp_getComment()} for a description of each item contents + * @return array|IXR_Error Contains a collection of comments. See wp_xmlrpc_server::wp_getComment() for a description of each item contents */ public function wp_getComments( $args ) { $this->escape( $args ); @@ -3328,8 +3331,7 @@ class wp_xmlrpc_server extends IXR_Server { * Delete a comment. * * By default, the comment will be moved to the trash instead of deleted. - * See {@link wp_delete_comment()} for more information on - * this behavior. + * See wp_delete_comment() for more information on this behavior. * * @since 2.7.0 * @@ -3341,7 +3343,7 @@ class wp_xmlrpc_server extends IXR_Server { * @type string $password * @type int $comment_ID * } - * @return bool|IXR_Error {@link wp_delete_comment()} + * @return bool|IXR_Error See wp_delete_comment(). */ public function wp_deleteComment( $args ) { $this->escape($args); @@ -3359,7 +3361,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( !current_user_can( 'edit_comment', $comment_ID ) ) { - return new IXR_Error( 403, __( 'You are not allowed to moderate or edit this comment.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) ); } /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ @@ -3426,7 +3428,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! current_user_can( 'edit_comment', $comment_ID ) ) { - return new IXR_Error( 403, __( 'You are not allowed to moderate or edit this comment.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) ); } /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ @@ -3498,7 +3500,7 @@ class wp_xmlrpc_server extends IXR_Server { * @type string|int $post * @type array $content_struct * } - * @return int|IXR_Error {@link wp_new_comment()} + * @return int|IXR_Error See wp_new_comment(). */ public function wp_newComment($args) { $this->escape($args); @@ -3509,7 +3511,7 @@ class wp_xmlrpc_server extends IXR_Server { $content_struct = $args[4]; /** - * Filter whether to allow anonymous comments over XML-RPC. + * Filters whether to allow anonymous comments over XML-RPC. * * @since 2.7.0 * @@ -3630,7 +3632,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! current_user_can( 'publish_posts' ) ) { - return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); } /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ @@ -3671,7 +3673,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! current_user_can( 'edit_post', $post_id ) ) { - return new IXR_Error( 403, __( 'You are not allowed access to details of this post.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details of this post.' ) ); } /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ @@ -3711,7 +3713,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'edit_posts' ) ) - return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.getPostStatusList' ); @@ -3743,7 +3745,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'edit_pages' ) ) - return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.getPageStatusList' ); @@ -3775,7 +3777,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'edit_pages' ) ) - return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); $templates = get_page_templates(); $templates['Default'] = 'default'; @@ -3869,7 +3871,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'manage_options' ) ) - return new IXR_Error( 403, __( 'You are not allowed to update options.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed to update options.' ) ); $option_names = array(); foreach ( $options as $o_name => $o_value ) { @@ -3921,7 +3923,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'upload_files' ) ) - return new IXR_Error( 403, __( 'You do not have permission to upload files.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed to upload files.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.getMediaItem' ); @@ -3969,7 +3971,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'upload_files' ) ) - return new IXR_Error( 401, __( 'You do not have permission to upload files.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.getMediaLibrary' ); @@ -4013,7 +4015,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'edit_posts' ) ) - return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); + return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.getPostFormats' ); @@ -4079,7 +4081,7 @@ class wp_xmlrpc_server extends IXR_Server { $fields = $args[4]; } else { /** - * Filter the default query fields used by the given XML-RPC method. + * Filters the default query fields used by the given XML-RPC method. * * @since 3.4.0 * @@ -4096,7 +4098,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.getPostType' ); if ( ! post_type_exists( $post_type_name ) ) - return new IXR_Error( 403, __( 'Invalid post type' ) ); + return new IXR_Error( 403, __( 'Invalid post type.' ) ); $post_type = get_post_type_object( $post_type_name ); @@ -4197,7 +4199,7 @@ class wp_xmlrpc_server extends IXR_Server { $fields = $args[4]; } else { /** - * Filter the default revision query fields used by the given XML-RPC method. + * Filters the default revision query fields used by the given XML-RPC method. * * @since 3.5.0 * @@ -4287,7 +4289,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 404, __( 'Invalid post ID.' ) ); if ( ! current_user_can( 'edit_post', $revision->post_parent ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); // Check if revisions are disabled. if ( ! wp_revisions_enabled( $post ) ) @@ -4299,7 +4301,7 @@ class wp_xmlrpc_server extends IXR_Server { } /* Blogger API functions. - * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/ + * specs on http://plant.blogger.com/api and https://groups.yahoo.com/group/bloggerDev/ */ /** @@ -4410,7 +4412,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( !current_user_can( 'edit_posts' ) ) - return new IXR_Error( 401, __( 'Sorry, you do not have access to user data on this site.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to access user data on this site.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'blogger.getUserInfo' ); @@ -4456,7 +4458,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 404, __( 'Invalid post ID.' ) ); if ( !current_user_can( 'edit_post', $post_ID ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'blogger.getPost' ); @@ -4509,7 +4511,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( ! current_user_can( 'edit_posts' ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'blogger.getRecentPosts' ); @@ -4683,10 +4685,10 @@ class wp_xmlrpc_server extends IXR_Server { $this->escape($actual_post); if ( ! current_user_can( 'edit_post', $post_ID ) ) { - return new IXR_Error(401, __('Sorry, you do not have the right to edit this post.')); + return new IXR_Error(401, __('Sorry, you are not allowed to edit this post.')); } if ( 'publish' == $actual_post['post_status'] && ! current_user_can( 'publish_posts' ) ) { - return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) ); } $postdata = array(); @@ -4753,7 +4755,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! current_user_can( 'delete_post', $post_ID ) ) { - return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) ); } $result = wp_delete_post( $post_ID ); @@ -4855,7 +4857,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_type = 'post'; } else { // No other post_type values are allowed here - return new IXR_Error( 401, __( 'Invalid post type' ) ); + return new IXR_Error( 401, __( 'Invalid post type.' ) ); } } else { if ( $publish ) @@ -4906,14 +4908,14 @@ class wp_xmlrpc_server extends IXR_Server { switch ( $post_type ) { case "post": if ( !current_user_can( 'edit_others_posts' ) ) - return new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) ); break; case "page": if ( !current_user_can( 'edit_others_pages' ) ) - return new IXR_Error( 401, __( 'You are not allowed to create pages as this user.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to create pages as this user.' ) ); break; default: - return new IXR_Error( 401, __( 'Invalid post type' ) ); + return new IXR_Error( 401, __( 'Invalid post type.' ) ); } $author = get_userdata( $content_struct['wp_author_id'] ); if ( ! $author ) @@ -5187,11 +5189,11 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 404, __( 'Invalid post ID.' ) ); if ( ! current_user_can( 'edit_post', $post_ID ) ) - return new IXR_Error( 401, __( 'Sorry, you do not have the right to edit this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); // Use wp.editPost to edit post types other than post and page. if ( ! in_array( $postdata[ 'post_type' ], array( 'post', 'page' ) ) ) - return new IXR_Error( 401, __( 'Invalid post type' ) ); + return new IXR_Error( 401, __( 'Invalid post type.' ) ); // Thwart attempt to change the post type. if ( ! empty( $content_struct[ 'post_type' ] ) && ( $content_struct['post_type'] != $postdata[ 'post_type' ] ) ) @@ -5246,16 +5248,16 @@ class wp_xmlrpc_server extends IXR_Server { switch ( $post_type ) { case 'post': if ( ! current_user_can( 'edit_others_posts' ) ) { - return new IXR_Error( 401, __( 'You are not allowed to change the post author as this user.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to change the post author as this user.' ) ); } break; case 'page': if ( ! current_user_can( 'edit_others_pages' ) ) { - return new IXR_Error( 401, __( 'You are not allowed to change the page author as this user.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to change the page author as this user.' ) ); } break; default: - return new IXR_Error( 401, __( 'Invalid post type' ) ); + return new IXR_Error( 401, __( 'Invalid post type.' ) ); } $post_author = $content_struct['wp_author_id']; } @@ -5358,9 +5360,9 @@ class wp_xmlrpc_server extends IXR_Server { if ( 'publish' == $post_status || 'private' == $post_status ) { if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) { - return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this page.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this page.' ) ); } elseif ( ! current_user_can( 'publish_posts' ) ) { - return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) ); } } @@ -5484,7 +5486,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 404, __( 'Invalid post ID.' ) ); if ( !current_user_can( 'edit_post', $post_ID ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'metaWeblog.getPost' ); @@ -5614,7 +5616,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; if ( ! current_user_can( 'edit_posts' ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'metaWeblog.getRecentPosts' ); @@ -5791,7 +5793,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'metaWeblog.newMediaObject' ); if ( !current_user_can('upload_files') ) { - $this->error = new IXR_Error( 401, __( 'You do not have permission to upload files.' ) ); + $this->error = new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) ); return $this->error; } @@ -5801,7 +5803,7 @@ class wp_xmlrpc_server extends IXR_Server { } /** - * Filter whether to preempt the XML-RPC media upload. + * Filters whether to preempt the XML-RPC media upload. * * Passing a truthy value will effectively short-circuit the media upload, * returning that value as a 500 error instead. @@ -5825,7 +5827,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_id = (int) $data['post_id']; if ( ! current_user_can( 'edit_post', $post_id ) ) - return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); } $attachment = array( 'post_title' => $name, @@ -5996,7 +5998,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 404, __( 'Invalid post ID.' ) ); if ( !current_user_can( 'edit_post', $post_ID ) ) - return new IXR_Error( 401, __( 'Sorry, you can not edit this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'mt.getPostCategories' ); @@ -6050,7 +6052,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 404, __( 'Invalid post ID.' ) ); if ( !current_user_can('edit_post', $post_ID) ) - return new IXR_Error(401, __('Sorry, you cannot edit this post.')); + return new IXR_Error(401, __('Sorry, you are not allowed to edit this post.')); $catids = array(); foreach ( $categories as $cat ) { @@ -6086,7 +6088,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'mt.supportedTextFilters' ); /** - * Filter the MoveableType text filters list for XML-RPC. + * Filters the MoveableType text filters list for XML-RPC. * * @since 2.2.0 * @@ -6169,7 +6171,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 404, __( 'Invalid post ID.' ) ); if ( !current_user_can('publish_posts') || !current_user_can('edit_post', $post_ID) ) - return new IXR_Error(401, __('Sorry, you cannot publish this post.')); + return new IXR_Error(401, __('Sorry, you are not allowed to publish this post.')); $postdata['post_status'] = 'publish'; @@ -6214,7 +6216,7 @@ class wp_xmlrpc_server extends IXR_Server { $pagelinkedto = str_replace( '&', '&', $pagelinkedto ); /** - * Filter the pingback source URI. + * Filters the pingback source URI. * * @since 3.6.0 * @@ -6311,7 +6313,7 @@ class wp_xmlrpc_server extends IXR_Server { } /** - * Filter the pingback remote source. + * Filters the pingback remote source. * * @since 2.5.0 * @@ -6457,7 +6459,7 @@ class wp_xmlrpc_server extends IXR_Server { */ protected function pingback_error( $code, $message ) { /** - * Filter the XML-RPC pingback error return. + * Filters the XML-RPC pingback error return. * * @since 3.5.1 *