wp_xmlrpc_server
- Since
- 1.5.0
- Source
wp-includes/class-wp-xmlrpc-server.php:23
WordPress XMLRPC server implementation.
Description
Implements compatibility for Blogger API, MetaWeblog API, MovableType, and pingback. Additional WordPress API for managing comments, pages, posts, 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::set_is_enabled().
Compatibility
- WordPress
- since 1.5.0
- 6.7.10
- 6.8.11
- 6.9.10
- 7.0.7
- 7.1.3
Present in every tracked release (6.7.10 to 7.1.3).
Hooks and filters fired · 114
Every hook that fires from inside wp_xmlrpc_server, in the order it appears in the class, grouped by the method that fires it.
wp_xmlrpc_server::set_is_enabled()
- apply_filters( pre_option_enable_xmlrpc )filter line 194
- apply_filters( option_enable_xmlrpc )filter line 196
- apply_filters( xmlrpc_enabled )filter line 221
wp_xmlrpc_server::login()
- apply_filters( xmlrpc_login_error )filter line 323
wp_xmlrpc_server::wp_getUsersBlogs()
- do_action( xmlrpc_call )action line 749
wp_xmlrpc_server::wp_newPost()
- do_action( xmlrpc_call )action line 1363
wp_xmlrpc_server::_insert_post()
- apply_filters( xmlrpc_allow_post_type_writes )filter line 1483
- apply_filters( xmlrpc_wp_insert_post_data )filter line 1728
wp_xmlrpc_server::wp_editPost()
- do_action( xmlrpc_call )action line 1791
wp_xmlrpc_server::wp_deletePost()
- do_action( xmlrpc_call )action line 1874
wp_xmlrpc_server::wp_getPost()
- apply_filters( xmlrpc_default_post_fields )filter line 1966
- do_action( xmlrpc_call )action line 1975
wp_xmlrpc_server::wp_getPosts()
- apply_filters( xmlrpc_default_post_fields )filter line 2027
- do_action( xmlrpc_call )action line 2036
wp_xmlrpc_server::wp_newTerm()
- do_action( xmlrpc_call )action line 2135
wp_xmlrpc_server::wp_editTerm()
- do_action( xmlrpc_call )action line 2240
wp_xmlrpc_server::wp_deleteTerm()
- do_action( xmlrpc_call )action line 2356
wp_xmlrpc_server::wp_getTerm()
- do_action( xmlrpc_call )action line 2435
wp_xmlrpc_server::wp_getTerms()
- do_action( xmlrpc_call )action line 2500
wp_xmlrpc_server::wp_getTaxonomy()
- apply_filters( xmlrpc_default_taxonomy_fields )filter line 2598
- do_action( xmlrpc_call )action line 2607
wp_xmlrpc_server::wp_getTaxonomies()
- apply_filters( xmlrpc_default_taxonomy_fields )filter line 2656
- do_action( xmlrpc_call )action line 2665
wp_xmlrpc_server::wp_getUser()
- apply_filters( xmlrpc_default_user_fields )filter line 2742
- do_action( xmlrpc_call )action line 2751
wp_xmlrpc_server::wp_getUsers()
- apply_filters( xmlrpc_default_user_fields )filter line 2805
- do_action( xmlrpc_call )action line 2814
wp_xmlrpc_server::wp_getProfile()
- apply_filters( xmlrpc_default_user_fields )filter line 2885
- do_action( xmlrpc_call )action line 2894
wp_xmlrpc_server::wp_editProfile()
- do_action( xmlrpc_call )action line 2944
wp_xmlrpc_server::wp_getPage()
- do_action( xmlrpc_call )action line 3033
wp_xmlrpc_server::wp_getPages()
- do_action( xmlrpc_call )action line 3076
wp_xmlrpc_server::wp_newPage()
- do_action( xmlrpc_call )action line 3131
wp_xmlrpc_server::wp_deletePage()
- do_action( xmlrpc_call )action line 3168
- do_action( xmlrpc_call_success_wp_deletePage )action line 3198
wp_xmlrpc_server::wp_editPage()
- do_action( xmlrpc_call )action line 3237
wp_xmlrpc_server::wp_getPageList()
- do_action( xmlrpc_call )action line 3300
wp_xmlrpc_server::wp_getAuthors()
- do_action( xmlrpc_call )action line 3361
wp_xmlrpc_server::wp_getTags()
- do_action( xmlrpc_call )action line 3405
wp_xmlrpc_server::wp_newCategory()
- do_action( xmlrpc_call )action line 3455
- do_action( xmlrpc_call_success_wp_newCategory )action line 3509
wp_xmlrpc_server::wp_deleteCategory()
- do_action( xmlrpc_call )action line 3542
- do_action( xmlrpc_call_success_wp_deleteCategory )action line 3559
wp_xmlrpc_server::wp_suggestCategories()
- do_action( xmlrpc_call )action line 3599
wp_xmlrpc_server::wp_getComment()
- do_action( xmlrpc_call )action line 3645
wp_xmlrpc_server::wp_getComments()
- do_action( xmlrpc_call )action line 3701
wp_xmlrpc_server::wp_deleteComment()
- do_action( xmlrpc_call )action line 3792
- do_action( xmlrpc_call_success_wp_deleteComment )action line 3805
wp_xmlrpc_server::wp_editComment()
- do_action( xmlrpc_call )action line 3860
- do_action( xmlrpc_call_success_wp_editComment )action line 3918
wp_xmlrpc_server::wp_newComment()
- apply_filters( xmlrpc_allow_anonymous_comments )filter line 3955
- apply_filters( allow_empty_comment )filter line 4047
- do_action( xmlrpc_call )action line 4054
- do_action( xmlrpc_call_success_wp_newComment )action line 4073
wp_xmlrpc_server::wp_getCommentCount()
- do_action( xmlrpc_call )action line 4150
wp_xmlrpc_server::wp_getPostStatusList()
- do_action( xmlrpc_call )action line 4192
wp_xmlrpc_server::wp_getPageStatusList()
- do_action( xmlrpc_call )action line 4227
wp_xmlrpc_server::wp_getMediaItem()
- do_action( xmlrpc_call )action line 4420
wp_xmlrpc_server::wp_getMediaLibrary()
- do_action( xmlrpc_call )action line 4476
wp_xmlrpc_server::wp_getPostFormats()
- do_action( xmlrpc_call )action line 4532
wp_xmlrpc_server::wp_getPostType()
- apply_filters( xmlrpc_default_posttype_fields )filter line 4604
- do_action( xmlrpc_call )action line 4613
wp_xmlrpc_server::wp_getPostTypes()
- apply_filters( xmlrpc_default_posttype_fields )filter line 4661
- do_action( xmlrpc_call )action line 4670
wp_xmlrpc_server::wp_getRevisions()
- apply_filters( xmlrpc_default_revision_fields )filter line 4732
- do_action( xmlrpc_call )action line 4741
wp_xmlrpc_server::wp_restoreRevision()
- do_action( xmlrpc_call )action line 4815
wp_xmlrpc_server::blogger_getUserInfo()
- do_action( xmlrpc_call )action line 4970
wp_xmlrpc_server::blogger_getPost()
- do_action( xmlrpc_call )action line 5020
wp_xmlrpc_server::blogger_newPost()
- do_action( xmlrpc_call )action line 5167
- do_action( xmlrpc_call_success_blogger_newPost )action line 5214
wp_xmlrpc_server::blogger_editPost()
- do_action( xmlrpc_call )action line 5252
- do_action( xmlrpc_call_success_blogger_editPost )action line 5293
wp_xmlrpc_server::blogger_deletePost()
- do_action( xmlrpc_call )action line 5326
- do_action( xmlrpc_call_success_blogger_deletePost )action line 5352
wp_xmlrpc_server::mw_newPost()
- do_action( xmlrpc_call )action line 5414
- do_action( xmlrpc_call_success_mw_newPost )action line 5722
wp_xmlrpc_server::mw_editPost()
- do_action( xmlrpc_call )action line 5810
- do_action( xmlrpc_call_success_mw_editPost )action line 6129
wp_xmlrpc_server::mw_getPost()
- do_action( xmlrpc_call )action line 6170
wp_xmlrpc_server::mw_getRecentPosts()
- do_action( xmlrpc_call )action line 6311
wp_xmlrpc_server::mw_getCategories()
- do_action( xmlrpc_call )action line 6432
wp_xmlrpc_server::mw_newMediaObject()
- do_action( xmlrpc_call )action line 6489
- apply_filters( pre_upload_error )filter line 6518
- do_action( xmlrpc_call_success_mw_newMediaObject )action line 6561
wp_xmlrpc_server::mt_getCategoryList()
- do_action( xmlrpc_call )action line 6672
wp_xmlrpc_server::mt_getPostCategories()
- do_action( xmlrpc_call )action line 6730
wp_xmlrpc_server::mt_setPostCategories()
- do_action( xmlrpc_call )action line 6777
wp_xmlrpc_server::mt_supportedMethods()
- do_action( xmlrpc_call )action line 6806
wp_xmlrpc_server::mt_supportedTextFilters()
- do_action( xmlrpc_call )action line 6818
- apply_filters( xmlrpc_text_filters )filter line 6827
wp_xmlrpc_server::mt_getTrackbackPings()
- do_action( xmlrpc_call )action line 6844
wp_xmlrpc_server::mt_publishPost()
- do_action( xmlrpc_call )action line 6901
wp_xmlrpc_server::pingback_ping()
- do_action( xmlrpc_call )action line 6945
- apply_filters( pingback_ping_source_uri )filter line 6961
- apply_filters( http_headers_useragent )filter line 7053
- apply_filters( pre_remote_source )filter line 7082
- do_action( pingback_post )action line 7180
Properties · 5
$methodsarraypublic- Methods.
$blog_optionsarraypublic- Blog options.
$errorIXR_Errorpublic- IXR_Error instance.
$auth_failedboolprotected- Flags that the user authentication has failed in this instance of wp_xmlrpc_server.
$is_enabledboolprivate- Flags that XML-RPC is enabled
Methods · 106
- __construct()Registers all of the XMLRPC methods that XMLRPC server understands.
- set_is_enabled()Sets wp_xmlrpc_server::$is_enabled property.
- __call()Makes private/protected methods readable for backward compatibility.
- serve_request()Serves the XML-RPC request.
- sayHello()Tests XMLRPC API by saying, "Hello!" to client.
- addTwoNumbers()Tests XMLRPC API by adding two numbers for client.
- login()Logs user in.
- login_pass_ok()Checks user's credentials. Deprecated.
- escape()Escapes string or array of strings for database.
- error()Sends error response to client.
- get_custom_fields()Retrieves custom fields for post.
- set_custom_fields()Sets custom fields for post.
- get_term_custom_fields()Retrieves custom fields for a term.
- set_term_custom_fields()Sets custom fields for a term.
- initialise_blog_option_info()Sets up blog options property.
- wp_getUsersBlogs()Retrieves the blogs of the user.
- minimum_args()Checks if the method received at least the minimum number of arguments.
- _prepare_taxonomy()Prepares taxonomy data for return in an XML-RPC object.
- _prepare_term()Prepares term data for return in an XML-RPC object.
- _convert_date()Converts a WordPress date string to an IXR_Date object.
- _convert_date_gmt()Converts a WordPress GMT date string to an IXR_Date object.
- _prepare_post()Prepares post data for return in an XML-RPC object.
- _prepare_post_type()Prepares post data for return in an XML-RPC object.
- _prepare_media_item()Prepares media item data for return in an XML-RPC object.
- _prepare_page()Prepares page data for return in an XML-RPC object.
- _prepare_comment()Prepares comment data for return in an XML-RPC object.
- _prepare_user()Prepares user data for return in an XML-RPC object.
- wp_newPost()Creates a new post for any registered post type.
- _is_greater_than_one()Helper method for filtering out elements from an array.
- _toggle_sticky()Encapsulates the logic for sticking a post and determining if the user has permission to do so.
- _insert_post()Helper method for wp_newPost() and wp_editPost(), containing shared logic.
- wp_editPost()Edits a post for any registered post type.
- wp_deletePost()Deletes a post for any registered post type.
- wp_getPost()Retrieves a post.
- wp_getPosts()Retrieves posts.
- wp_newTerm()Creates a new term.
- wp_editTerm()Edits a term.
- wp_deleteTerm()Deletes a term.
- wp_getTerm()Retrieves a term.
- wp_getTerms()Retrieves all terms for a taxonomy.
- wp_getTaxonomy()Retrieves a taxonomy.
- wp_getTaxonomies()Retrieves all taxonomies.
- wp_getUser()Retrieves a user.
- wp_getUsers()Retrieves users.
- wp_getProfile()Retrieves information about the requesting user.
- wp_editProfile()Edits user's profile.
- wp_getPage()Retrieves a page.
- wp_getPages()Retrieves Pages.
- wp_newPage()Creates a new page.
- wp_deletePage()Deletes a page.
- wp_editPage()Edits a page.
- wp_getPageList()Retrieves page list.
- wp_getAuthors()Retrieves authors list.
- wp_getTags()Gets the list of all tags.
- wp_newCategory()Creates a new category.
- wp_deleteCategory()Deletes a category.
- wp_suggestCategories()Retrieves category list.
- wp_getComment()Retrieves a comment.
- wp_getComments()Retrieves comments.
- wp_deleteComment()Deletes a comment.
- wp_editComment()Edits a comment.
- wp_newComment()Creates a new comment.
- wp_getCommentStatusList()Retrieves all of the comment status.
- wp_getCommentCount()Retrieves comment counts.
- wp_getPostStatusList()Retrieves post statuses.
- wp_getPageStatusList()Retrieves page statuses.
- wp_getPageTemplates()Retrieves page templates.
- wp_getOptions()Retrieves blog options.
- _getOptions()Retrieves blog options value from list.
- wp_setOptions()Updates blog options.
- wp_getMediaItem()Retrieves a media item by ID.
- wp_getMediaLibrary()Retrieves a collection of media library items (or attachments).
- wp_getPostFormats()Retrieves a list of post formats used by the site.
- wp_getPostType()Retrieves a post type.
- wp_getPostTypes()Retrieves post types.
- wp_getRevisions()Retrieves revisions for a specific post.
- wp_restoreRevision()Restores a post revision.
- blogger_getUsersBlogs()Retrieves blogs that user owns.
- _multisite_getUsersBlogs()Private function for retrieving a users blogs for multisite setups.
- blogger_getUserInfo()Retrieves user's data.
- blogger_getPost()Retrieves a post.
- blogger_getRecentPosts()Retrieves the list of recent posts.
- blogger_getTemplate()Deprecated.
- blogger_setTemplate()Deprecated.
- blogger_newPost()Creates a new post.
- blogger_editPost()Edits a post.
- blogger_deletePost()Deletes a post.
- mw_newPost()Creates a new post.
- add_enclosure_if_new()Adds an enclosure to a post if it's new.
- attach_uploads()Attaches an upload to a post.
- mw_editPost()Edits a post.
- mw_getPost()Retrieves a post.
- mw_getRecentPosts()Retrieves list of recent posts.
- mw_getCategories()Retrieves the list of categories on a given blog.
- mw_newMediaObject()Uploads a file, following your settings.
- mt_getRecentPostTitles()Retrieves the post titles of recent posts.
- mt_getCategoryList()Retrieves the list of all categories on a blog.
- mt_getPostCategories()Retrieves post categories.
- mt_setPostCategories()Sets categories for a post.
- mt_supportedMethods()Retrieves an array of methods supported by this server.
- mt_supportedTextFilters()Retrieves an empty array because we don't support per-post text filters.
- mt_getTrackbackPings()Retrieves trackbacks sent to a given post.
- mt_publishPost()Sets a post's publish status to 'publish'.
- pingback_ping()Retrieves a pingback and registers it.
- pingback_extensions_getPingbacks()Retrieves an array of URLs that pingbacked the given URL.
- pingback_error()Sends a pingback error based on the given error code and message.
Source code
#[AllowDynamicProperties]class wp_xmlrpc_server extends IXR_Server { /** * Methods. * * @var array */ public $methods; /** * Blog options. * * @var array */ public $blog_options; /** * IXR_Error instance. * * @var IXR_Error */ public $error; /** * Flags that the user authentication has failed in this instance of wp_xmlrpc_server. * * @var bool */ protected $auth_failed = false; /** * Flags that XML-RPC is enabled * * @var bool */ private $is_enabled; /** * Registers all of the XMLRPC methods that XMLRPC server understands. * * Sets up server and method property. Passes XMLRPC methods through the * {@see 'xmlrpc_methods'} filter to allow plugins to extend or replace * XML-RPC methods. * * @since 1.5.0 */ public function __construct() { $this->methods = array( // WordPress API. 'wp.getUsersBlogs' => 'this:wp_getUsersBlogs', 'wp.newPost' => 'this:wp_newPost', 'wp.editPost' => 'this:wp_editPost', 'wp.deletePost' => 'this:wp_deletePost', 'wp.getPost' => 'this:wp_getPost', 'wp.getPosts' => 'this:wp_getPosts', 'wp.newTerm' => 'this:wp_newTerm', 'wp.editTerm' => 'this:wp_editTerm', 'wp.deleteTerm' => 'this:wp_deleteTerm', 'wp.getTerm' => 'this:wp_getTerm', 'wp.getTerms' => 'this:wp_getTerms', 'wp.getTaxonomy' => 'this:wp_getTaxonomy', 'wp.getTaxonomies' => 'this:wp_getTaxonomies', 'wp.getUser' => 'this:wp_getUser', 'wp.getUsers' => 'this:wp_getUsers', 'wp.getProfile' => 'this:wp_getProfile', 'wp.editProfile' => 'this:wp_editProfile', 'wp.getPage' => 'this:wp_getPage', 'wp.getPages' => 'this:wp_getPages', 'wp.newPage' => 'this:wp_newPage', 'wp.deletePage' => 'this:wp_deletePage', 'wp.editPage' => 'this:wp_editPage', 'wp.getPageList' => 'this:wp_getPageList', 'wp.getAuthors' => 'this:wp_getAuthors', 'wp.getCategories' => 'this:mw_getCategories', // Alias. 'wp.getTags' => 'this:wp_getTags', 'wp.newCategory' => 'this:wp_newCategory', 'wp.deleteCategory' => 'this:wp_deleteCategory', 'wp.suggestCategories' => 'this:wp_suggestCategories', 'wp.uploadFile' => 'this:mw_newMediaObject', // Alias. 'wp.deleteFile' => 'this:wp_deletePost', // Alias.Changelog
Introduced in 1.5.0. Unchanged from 6.7.10 through 7.1.3.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.7 tag, from
src/wp-includes/class-wp-xmlrpc-server.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.