XML-RPC: Pass the method arguments and the XML-RPC server instance to the `xmlrpc_call` action.

This provides better context and makes the action easier to use when the call passes specific content in the payload of the request.

Props dd32.
Fixes #52524.
Built from https://develop.svn.wordpress.org/trunk@50353


git-svn-id: http://core.svn.wordpress.org/trunk@49964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-02-16 17:03:05 +00:00
parent 7b5e14e987
commit ec94c354e2
2 changed files with 72 additions and 69 deletions

View File

@ -681,10 +681,13 @@ class wp_xmlrpc_server extends IXR_Server {
* equal to the method's name, e.g., wp.getUsersBlogs, wp.newPost, etc. * equal to the method's name, e.g., wp.getUsersBlogs, wp.newPost, etc.
* *
* @since 2.5.0 * @since 2.5.0
* @since 5.7.0 Added the `$args` and `$server` parameters.
* *
* @param string $name The method name. * @param string $name The method name.
* @param array|string $args The escaped arguments passed to the method.
* @param wp_xmlrpc_server $server The XML-RPC server instance.
*/ */
do_action( 'xmlrpc_call', 'wp.getUsersBlogs' ); do_action( 'xmlrpc_call', 'wp.getUsersBlogs', $args, $this );
$blogs = (array) get_blogs_of_user( $user->ID ); $blogs = (array) get_blogs_of_user( $user->ID );
$struct = array(); $struct = array();
@ -1294,7 +1297,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.newPost' ); do_action( 'xmlrpc_call', 'wp.newPost', $args, $this );
unset( $content_struct['ID'] ); unset( $content_struct['ID'] );
@ -1687,7 +1690,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.editPost' ); do_action( 'xmlrpc_call', 'wp.editPost', $args, $this );
$post = get_post( $post_id, ARRAY_A ); $post = get_post( $post_id, ARRAY_A );
@ -1770,7 +1773,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.deletePost' ); do_action( 'xmlrpc_call', 'wp.deletePost', $args, $this );
$post = get_post( $post_id, ARRAY_A ); $post = get_post( $post_id, ARRAY_A );
if ( empty( $post['ID'] ) ) { if ( empty( $post['ID'] ) ) {
@ -1870,7 +1873,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPost' ); do_action( 'xmlrpc_call', 'wp.getPost', $args, $this );
$post = get_post( $post_id, ARRAY_A ); $post = get_post( $post_id, ARRAY_A );
@ -1931,7 +1934,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPosts' ); do_action( 'xmlrpc_call', 'wp.getPosts', $args, $this );
$query = array(); $query = array();
@ -2030,7 +2033,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.newTerm' ); do_action( 'xmlrpc_call', 'wp.newTerm', $args, $this );
if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) { if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) {
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
@ -2135,7 +2138,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.editTerm' ); do_action( 'xmlrpc_call', 'wp.editTerm', $args, $this );
if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) { if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) {
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
@ -2251,7 +2254,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.deleteTerm' ); do_action( 'xmlrpc_call', 'wp.deleteTerm', $args, $this );
if ( ! taxonomy_exists( $taxonomy ) ) { if ( ! taxonomy_exists( $taxonomy ) ) {
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
@ -2330,7 +2333,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getTerm' ); do_action( 'xmlrpc_call', 'wp.getTerm', $args, $this );
if ( ! taxonomy_exists( $taxonomy ) ) { if ( ! taxonomy_exists( $taxonomy ) ) {
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
@ -2395,7 +2398,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getTerms' ); do_action( 'xmlrpc_call', 'wp.getTerms', $args, $this );
if ( ! taxonomy_exists( $taxonomy ) ) { if ( ! taxonomy_exists( $taxonomy ) ) {
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
@ -2501,7 +2504,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getTaxonomy' ); do_action( 'xmlrpc_call', 'wp.getTaxonomy', $args, $this );
if ( ! taxonomy_exists( $taxonomy ) ) { if ( ! taxonomy_exists( $taxonomy ) ) {
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
@ -2559,7 +2562,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getTaxonomies' ); do_action( 'xmlrpc_call', 'wp.getTaxonomies', $args, $this );
$taxonomies = get_taxonomies( $filter, 'objects' ); $taxonomies = get_taxonomies( $filter, 'objects' );
@ -2645,7 +2648,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getUser' ); do_action( 'xmlrpc_call', 'wp.getUser', $args, $this );
if ( ! current_user_can( 'edit_user', $user_id ) ) { if ( ! current_user_can( 'edit_user', $user_id ) ) {
return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this user.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this user.' ) );
@ -2708,7 +2711,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getUsers' ); do_action( 'xmlrpc_call', 'wp.getUsers', $args, $this );
if ( ! current_user_can( 'list_users' ) ) { if ( ! current_user_can( 'list_users' ) ) {
return new IXR_Error( 401, __( 'Sorry, you are not allowed to list users.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to list users.' ) );
@ -2788,7 +2791,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getProfile' ); do_action( 'xmlrpc_call', 'wp.getProfile', $args, $this );
if ( ! current_user_can( 'edit_user', $user->ID ) ) { if ( ! current_user_can( 'edit_user', $user->ID ) ) {
return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) );
@ -2838,7 +2841,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.editProfile' ); do_action( 'xmlrpc_call', 'wp.editProfile', $args, $this );
if ( ! current_user_can( 'edit_user', $user->ID ) ) { if ( ! current_user_can( 'edit_user', $user->ID ) ) {
return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) );
@ -2927,7 +2930,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPage' ); do_action( 'xmlrpc_call', 'wp.getPage', $args, $this );
// If we found the page then format the data. // If we found the page then format the data.
if ( $page->ID && ( 'page' === $page->post_type ) ) { if ( $page->ID && ( 'page' === $page->post_type ) ) {
@ -2970,7 +2973,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPages' ); do_action( 'xmlrpc_call', 'wp.getPages', $args, $this );
$pages = get_posts( $pages = get_posts(
array( array(
@ -3025,7 +3028,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.newPage' ); do_action( 'xmlrpc_call', 'wp.newPage', $args, $this );
// Mark this as content for a page. // Mark this as content for a page.
$args[3]['post_type'] = 'page'; $args[3]['post_type'] = 'page';
@ -3062,7 +3065,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.deletePage' ); do_action( 'xmlrpc_call', 'wp.deletePage', $args, $this );
// Get the current page based on the 'page_id' and // Get the current page based on the 'page_id' and
// make sure it is a page and not a post. // make sure it is a page and not a post.
@ -3129,7 +3132,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.editPage' ); do_action( 'xmlrpc_call', 'wp.editPage', $args, $this );
// Get the page data and make sure it is a page. // Get the page data and make sure it is a page.
$actual_page = get_post( $page_id, ARRAY_A ); $actual_page = get_post( $page_id, ARRAY_A );
@ -3192,7 +3195,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPageList' ); do_action( 'xmlrpc_call', 'wp.getPageList', $args, $this );
// Get list of page IDs and titles. // Get list of page IDs and titles.
$page_list = $wpdb->get_results( $page_list = $wpdb->get_results(
@ -3253,7 +3256,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getAuthors' ); do_action( 'xmlrpc_call', 'wp.getAuthors', $args, $this );
$authors = array(); $authors = array();
foreach ( get_users( array( 'fields' => array( 'ID', 'user_login', 'display_name' ) ) ) as $user ) { foreach ( get_users( array( 'fields' => array( 'ID', 'user_login', 'display_name' ) ) ) as $user ) {
@ -3297,7 +3300,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getKeywords' ); do_action( 'xmlrpc_call', 'wp.getKeywords', $args, $this );
$tags = array(); $tags = array();
@ -3347,7 +3350,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.newCategory' ); do_action( 'xmlrpc_call', 'wp.newCategory', $args, $this );
// Make sure the user is allowed to add a category. // Make sure the user is allowed to add a category.
if ( ! current_user_can( 'manage_categories' ) ) { if ( ! current_user_can( 'manage_categories' ) ) {
@ -3430,7 +3433,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.deleteCategory' ); do_action( 'xmlrpc_call', 'wp.deleteCategory', $args, $this );
if ( ! current_user_can( 'delete_term', $category_id ) ) { if ( ! current_user_can( 'delete_term', $category_id ) ) {
return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this category.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this category.' ) );
@ -3487,7 +3490,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.suggestCategories' ); do_action( 'xmlrpc_call', 'wp.suggestCategories', $args, $this );
$category_suggestions = array(); $category_suggestions = array();
$args = array( $args = array(
@ -3533,7 +3536,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getComment' ); do_action( 'xmlrpc_call', 'wp.getComment', $args, $this );
$comment = get_comment( $comment_id ); $comment = get_comment( $comment_id );
if ( ! $comment ) { if ( ! $comment ) {
@ -3586,7 +3589,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getComments' ); do_action( 'xmlrpc_call', 'wp.getComments', $args, $this );
if ( isset( $struct['status'] ) ) { if ( isset( $struct['status'] ) ) {
$status = $struct['status']; $status = $struct['status'];
@ -3681,7 +3684,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.deleteComment' ); do_action( 'xmlrpc_call', 'wp.deleteComment', $args, $this );
$status = wp_delete_comment( $comment_ID ); $status = wp_delete_comment( $comment_ID );
@ -3749,7 +3752,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.editComment' ); do_action( 'xmlrpc_call', 'wp.editComment', $args, $this );
$comment = array( $comment = array(
'comment_ID' => $comment_ID, 'comment_ID' => $comment_ID,
); );
@ -3942,7 +3945,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.newComment' ); do_action( 'xmlrpc_call', 'wp.newComment', $args, $this );
$comment_ID = wp_new_comment( $comment, true ); $comment_ID = wp_new_comment( $comment, true );
if ( is_wp_error( $comment_ID ) ) { if ( is_wp_error( $comment_ID ) ) {
@ -3996,7 +3999,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getCommentStatusList' ); do_action( 'xmlrpc_call', 'wp.getCommentStatusList', $args, $this );
return get_comment_statuses(); return get_comment_statuses();
} }
@ -4038,7 +4041,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getCommentCount' ); do_action( 'xmlrpc_call', 'wp.getCommentCount', $args, $this );
$count = wp_count_comments( $post_id ); $count = wp_count_comments( $post_id );
@ -4080,7 +4083,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPostStatusList' ); do_action( 'xmlrpc_call', 'wp.getPostStatusList', $args, $this );
return get_post_statuses(); return get_post_statuses();
} }
@ -4115,7 +4118,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPageStatusList' ); do_action( 'xmlrpc_call', 'wp.getPageStatusList', $args, $this );
return get_page_statuses(); return get_page_statuses();
} }
@ -4308,7 +4311,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getMediaItem' ); do_action( 'xmlrpc_call', 'wp.getMediaItem', $args, $this );
$attachment = get_post( $attachment_id ); $attachment = get_post( $attachment_id );
if ( ! $attachment || 'attachment' !== $attachment->post_type ) { if ( ! $attachment || 'attachment' !== $attachment->post_type ) {
@ -4361,7 +4364,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getMediaLibrary' ); do_action( 'xmlrpc_call', 'wp.getMediaLibrary', $args, $this );
$parent_id = ( isset( $struct['parent_id'] ) ) ? absint( $struct['parent_id'] ) : ''; $parent_id = ( isset( $struct['parent_id'] ) ) ? absint( $struct['parent_id'] ) : '';
$mime_type = ( isset( $struct['mime_type'] ) ) ? $struct['mime_type'] : ''; $mime_type = ( isset( $struct['mime_type'] ) ) ? $struct['mime_type'] : '';
@ -4417,7 +4420,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPostFormats' ); do_action( 'xmlrpc_call', 'wp.getPostFormats', $args, $this );
$formats = get_post_format_strings(); $formats = get_post_format_strings();
@ -4497,7 +4500,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPostType' ); do_action( 'xmlrpc_call', 'wp.getPostType', $args, $this );
if ( ! post_type_exists( $post_type_name ) ) { if ( ! post_type_exists( $post_type_name ) ) {
return new IXR_Error( 403, __( 'Invalid post type.' ) ); return new IXR_Error( 403, __( 'Invalid post type.' ) );
@ -4554,7 +4557,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPostTypes' ); do_action( 'xmlrpc_call', 'wp.getPostTypes', $args, $this );
$post_types = get_post_types( $filter, 'objects' ); $post_types = get_post_types( $filter, 'objects' );
@ -4624,7 +4627,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getRevisions' ); do_action( 'xmlrpc_call', 'wp.getRevisions', $args, $this );
$post = get_post( $post_id ); $post = get_post( $post_id );
if ( ! $post ) { if ( ! $post ) {
@ -4698,7 +4701,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.restoreRevision' ); do_action( 'xmlrpc_call', 'wp.restoreRevision', $args, $this );
$revision = wp_get_post_revision( $revision_id ); $revision = wp_get_post_revision( $revision_id );
if ( ! $revision ) { if ( ! $revision ) {
@ -4769,7 +4772,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'blogger.getUsersBlogs' ); do_action( 'xmlrpc_call', 'blogger.getUsersBlogs', $args, $this );
$is_admin = current_user_can( 'manage_options' ); $is_admin = current_user_can( 'manage_options' );
@ -4855,7 +4858,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'blogger.getUserInfo' ); do_action( 'xmlrpc_call', 'blogger.getUserInfo', $args, $this );
$struct = array( $struct = array(
'nickname' => $user->nickname, 'nickname' => $user->nickname,
@ -4905,7 +4908,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'blogger.getPost' ); do_action( 'xmlrpc_call', 'blogger.getPost', $args, $this );
$categories = implode( ',', wp_get_post_categories( $post_ID ) ); $categories = implode( ',', wp_get_post_categories( $post_ID ) );
@ -4962,7 +4965,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'blogger.getRecentPosts' ); do_action( 'xmlrpc_call', 'blogger.getRecentPosts', $args, $this );
$posts_list = wp_get_recent_posts( $query ); $posts_list = wp_get_recent_posts( $query );
@ -5052,7 +5055,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'blogger.newPost' ); do_action( 'xmlrpc_call', 'blogger.newPost', $args, $this );
$cap = ( $publish ) ? 'publish_posts' : 'edit_posts'; $cap = ( $publish ) ? 'publish_posts' : 'edit_posts';
if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) || ! current_user_can( $cap ) ) { if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) || ! current_user_can( $cap ) ) {
@ -5129,7 +5132,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'blogger.editPost' ); do_action( 'xmlrpc_call', 'blogger.editPost', $args, $this );
$actual_post = get_post( $post_ID, ARRAY_A ); $actual_post = get_post( $post_ID, ARRAY_A );
@ -5203,7 +5206,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'blogger.deletePost' ); do_action( 'xmlrpc_call', 'blogger.deletePost', $args, $this );
$actual_post = get_post( $post_ID, ARRAY_A ); $actual_post = get_post( $post_ID, ARRAY_A );
@ -5291,7 +5294,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'metaWeblog.newPost' ); do_action( 'xmlrpc_call', 'metaWeblog.newPost', $args, $this );
$page_template = ''; $page_template = '';
if ( ! empty( $content_struct['post_type'] ) ) { if ( ! empty( $content_struct['post_type'] ) ) {
@ -5670,7 +5673,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'metaWeblog.editPost' ); do_action( 'xmlrpc_call', 'metaWeblog.editPost', $args, $this );
$postdata = get_post( $post_ID, ARRAY_A ); $postdata = get_post( $post_ID, ARRAY_A );
@ -6008,7 +6011,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'metaWeblog.getPost' ); do_action( 'xmlrpc_call', 'metaWeblog.getPost', $args, $this );
if ( '' !== $postdata['post_date'] ) { if ( '' !== $postdata['post_date'] ) {
$post_date = $this->_convert_date( $postdata['post_date'] ); $post_date = $this->_convert_date( $postdata['post_date'] );
@ -6149,7 +6152,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'metaWeblog.getRecentPosts' ); do_action( 'xmlrpc_call', 'metaWeblog.getRecentPosts', $args, $this );
$posts_list = wp_get_recent_posts( $query ); $posts_list = wp_get_recent_posts( $query );
@ -6270,7 +6273,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'metaWeblog.getCategories' ); do_action( 'xmlrpc_call', 'metaWeblog.getCategories', $args, $this );
$categories_struct = array(); $categories_struct = array();
@ -6331,7 +6334,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'metaWeblog.newMediaObject' ); do_action( 'xmlrpc_call', 'metaWeblog.newMediaObject', $args, $this );
if ( ! current_user_can( 'upload_files' ) ) { if ( ! current_user_can( 'upload_files' ) ) {
$this->error = new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) ); $this->error = new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) );
@ -6450,7 +6453,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'mt.getRecentPostTitles' ); do_action( 'xmlrpc_call', 'mt.getRecentPostTitles', $args, $this );
$posts_list = wp_get_recent_posts( $query ); $posts_list = wp_get_recent_posts( $query );
@ -6512,7 +6515,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'mt.getCategoryList' ); do_action( 'xmlrpc_call', 'mt.getCategoryList', $args, $this );
$categories_struct = array(); $categories_struct = array();
@ -6570,7 +6573,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'mt.getPostCategories' ); do_action( 'xmlrpc_call', 'mt.getPostCategories', $args, $this );
$categories = array(); $categories = array();
$catids = wp_get_post_categories( (int) $post_ID ); $catids = wp_get_post_categories( (int) $post_ID );
@ -6617,7 +6620,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'mt.setPostCategories' ); do_action( 'xmlrpc_call', 'mt.setPostCategories', $args, $this );
if ( ! get_post( $post_ID ) ) { if ( ! get_post( $post_ID ) ) {
return new IXR_Error( 404, __( 'Invalid post ID.' ) ); return new IXR_Error( 404, __( 'Invalid post ID.' ) );
@ -6646,7 +6649,7 @@ class wp_xmlrpc_server extends IXR_Server {
*/ */
public function mt_supportedMethods() { public function mt_supportedMethods() {
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'mt.supportedMethods' ); do_action( 'xmlrpc_call', 'mt.supportedMethods', $args, $this );
return array_keys( $this->methods ); return array_keys( $this->methods );
} }
@ -6658,7 +6661,7 @@ class wp_xmlrpc_server extends IXR_Server {
*/ */
public function mt_supportedTextFilters() { public function mt_supportedTextFilters() {
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'mt.supportedTextFilters' ); do_action( 'xmlrpc_call', 'mt.supportedTextFilters', $args, $this );
/** /**
* Filters the MoveableType text filters list for XML-RPC. * Filters the MoveableType text filters list for XML-RPC.
@ -6684,7 +6687,7 @@ class wp_xmlrpc_server extends IXR_Server {
global $wpdb; global $wpdb;
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'mt.getTrackbackPings' ); do_action( 'xmlrpc_call', 'mt.getTrackbackPings', $post_ID, $this );
$actual_post = get_post( $post_ID, ARRAY_A ); $actual_post = get_post( $post_ID, ARRAY_A );
@ -6741,7 +6744,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'mt.publishPost' ); do_action( 'xmlrpc_call', 'mt.publishPost', $args, $this );
$postdata = get_post( $post_ID, ARRAY_A ); $postdata = get_post( $post_ID, ARRAY_A );
if ( ! $postdata ) { if ( ! $postdata ) {
@ -6783,7 +6786,7 @@ class wp_xmlrpc_server extends IXR_Server {
global $wpdb; global $wpdb;
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'pingback.ping' ); do_action( 'xmlrpc_call', 'pingback.ping', $args, $this );
$this->escape( $args ); $this->escape( $args );
@ -7022,7 +7025,7 @@ class wp_xmlrpc_server extends IXR_Server {
global $wpdb; global $wpdb;
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'pingback.extensions.getPingbacks' ); do_action( 'xmlrpc_call', 'pingback.extensions.getPingbacks', $url, $this );
$url = $this->escape( $url ); $url = $this->escape( $url );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.7-beta2-50352'; $wp_version = '5.7-beta2-50353';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.