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.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 113
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 318
wp_xmlrpc_server::wp_getUsersBlogs()
- do_action( xmlrpc_call )action line 744
wp_xmlrpc_server::wp_newPost()
- do_action( xmlrpc_call )action line 1358
wp_xmlrpc_server::wp_editPost()
- do_action( xmlrpc_call )action line 1759
wp_xmlrpc_server::wp_deletePost()
- do_action( xmlrpc_call )action line 1842
wp_xmlrpc_server::wp_getPost()
- apply_filters( xmlrpc_default_post_fields )filter line 1934
- do_action( xmlrpc_call )action line 1943
wp_xmlrpc_server::wp_getPosts()
- apply_filters( xmlrpc_default_post_fields )filter line 1995
- do_action( xmlrpc_call )action line 2004
wp_xmlrpc_server::wp_newTerm()
- do_action( xmlrpc_call )action line 2103
wp_xmlrpc_server::wp_editTerm()
- do_action( xmlrpc_call )action line 2208
wp_xmlrpc_server::wp_deleteTerm()
- do_action( xmlrpc_call )action line 2324
wp_xmlrpc_server::wp_getTerm()
- do_action( xmlrpc_call )action line 2403
wp_xmlrpc_server::wp_getTerms()
- do_action( xmlrpc_call )action line 2468
wp_xmlrpc_server::wp_getTaxonomy()
- apply_filters( xmlrpc_default_taxonomy_fields )filter line 2566
- do_action( xmlrpc_call )action line 2575
wp_xmlrpc_server::wp_getTaxonomies()
- apply_filters( xmlrpc_default_taxonomy_fields )filter line 2624
- do_action( xmlrpc_call )action line 2633
wp_xmlrpc_server::wp_getUser()
- apply_filters( xmlrpc_default_user_fields )filter line 2710
- do_action( xmlrpc_call )action line 2719
wp_xmlrpc_server::wp_getUsers()
- apply_filters( xmlrpc_default_user_fields )filter line 2773
- do_action( xmlrpc_call )action line 2782
wp_xmlrpc_server::wp_getProfile()
- apply_filters( xmlrpc_default_user_fields )filter line 2853
- do_action( xmlrpc_call )action line 2862
wp_xmlrpc_server::wp_editProfile()
- do_action( xmlrpc_call )action line 2912
wp_xmlrpc_server::wp_getPage()
- do_action( xmlrpc_call )action line 3001
wp_xmlrpc_server::wp_getPages()
- do_action( xmlrpc_call )action line 3044
wp_xmlrpc_server::wp_newPage()
- do_action( xmlrpc_call )action line 3099
wp_xmlrpc_server::wp_deletePage()
- do_action( xmlrpc_call )action line 3136
- do_action( xmlrpc_call_success_wp_deletePage )action line 3166
wp_xmlrpc_server::wp_editPage()
- do_action( xmlrpc_call )action line 3205
wp_xmlrpc_server::wp_getPageList()
- do_action( xmlrpc_call )action line 3268
wp_xmlrpc_server::wp_getAuthors()
- do_action( xmlrpc_call )action line 3329
wp_xmlrpc_server::wp_getTags()
- do_action( xmlrpc_call )action line 3373
wp_xmlrpc_server::wp_newCategory()
- do_action( xmlrpc_call )action line 3423
- do_action( xmlrpc_call_success_wp_newCategory )action line 3477
wp_xmlrpc_server::wp_deleteCategory()
- do_action( xmlrpc_call )action line 3510
- do_action( xmlrpc_call_success_wp_deleteCategory )action line 3527
wp_xmlrpc_server::wp_suggestCategories()
- do_action( xmlrpc_call )action line 3567
wp_xmlrpc_server::wp_getComment()
- do_action( xmlrpc_call )action line 3613
wp_xmlrpc_server::wp_getComments()
- do_action( xmlrpc_call )action line 3669
wp_xmlrpc_server::wp_deleteComment()
- do_action( xmlrpc_call )action line 3764
- do_action( xmlrpc_call_success_wp_deleteComment )action line 3777
wp_xmlrpc_server::wp_editComment()
- do_action( xmlrpc_call )action line 3832
- do_action( xmlrpc_call_success_wp_editComment )action line 3890
wp_xmlrpc_server::wp_newComment()
- apply_filters( xmlrpc_allow_anonymous_comments )filter line 3927
- apply_filters( allow_empty_comment )filter line 4019
- do_action( xmlrpc_call )action line 4026
- do_action( xmlrpc_call_success_wp_newComment )action line 4045
wp_xmlrpc_server::wp_getCommentCount()
- do_action( xmlrpc_call )action line 4122
wp_xmlrpc_server::wp_getPostStatusList()
- do_action( xmlrpc_call )action line 4164
wp_xmlrpc_server::wp_getPageStatusList()
- do_action( xmlrpc_call )action line 4199
wp_xmlrpc_server::wp_getMediaItem()
- do_action( xmlrpc_call )action line 4392
wp_xmlrpc_server::wp_getMediaLibrary()
- do_action( xmlrpc_call )action line 4448
wp_xmlrpc_server::wp_getPostFormats()
- do_action( xmlrpc_call )action line 4504
wp_xmlrpc_server::wp_getPostType()
- apply_filters( xmlrpc_default_posttype_fields )filter line 4576
- do_action( xmlrpc_call )action line 4585
wp_xmlrpc_server::wp_getPostTypes()
- apply_filters( xmlrpc_default_posttype_fields )filter line 4633
- do_action( xmlrpc_call )action line 4642
wp_xmlrpc_server::wp_getRevisions()
- apply_filters( xmlrpc_default_revision_fields )filter line 4704
- do_action( xmlrpc_call )action line 4713
wp_xmlrpc_server::wp_restoreRevision()
- do_action( xmlrpc_call )action line 4787
wp_xmlrpc_server::blogger_getUserInfo()
- do_action( xmlrpc_call )action line 4942
wp_xmlrpc_server::blogger_getPost()
- do_action( xmlrpc_call )action line 4992
wp_xmlrpc_server::blogger_newPost()
- do_action( xmlrpc_call )action line 5139
- do_action( xmlrpc_call_success_blogger_newPost )action line 5186
wp_xmlrpc_server::blogger_editPost()
- do_action( xmlrpc_call )action line 5224
- do_action( xmlrpc_call_success_blogger_editPost )action line 5265
wp_xmlrpc_server::blogger_deletePost()
- do_action( xmlrpc_call )action line 5298
- do_action( xmlrpc_call_success_blogger_deletePost )action line 5324
wp_xmlrpc_server::mw_newPost()
- do_action( xmlrpc_call )action line 5386
- do_action( xmlrpc_call_success_mw_newPost )action line 5694
wp_xmlrpc_server::mw_editPost()
- do_action( xmlrpc_call )action line 5782
- do_action( xmlrpc_call_success_mw_editPost )action line 6101
wp_xmlrpc_server::mw_getPost()
- do_action( xmlrpc_call )action line 6142
wp_xmlrpc_server::mw_getRecentPosts()
- do_action( xmlrpc_call )action line 6283
wp_xmlrpc_server::mw_getCategories()
- do_action( xmlrpc_call )action line 6404
wp_xmlrpc_server::mw_newMediaObject()
- do_action( xmlrpc_call )action line 6461
- apply_filters( pre_upload_error )filter line 6490
- do_action( xmlrpc_call_success_mw_newMediaObject )action line 6533
wp_xmlrpc_server::mt_getCategoryList()
- do_action( xmlrpc_call )action line 6644
wp_xmlrpc_server::mt_getPostCategories()
- do_action( xmlrpc_call )action line 6702
wp_xmlrpc_server::mt_setPostCategories()
- do_action( xmlrpc_call )action line 6749
wp_xmlrpc_server::mt_supportedMethods()
- do_action( xmlrpc_call )action line 6778
wp_xmlrpc_server::mt_supportedTextFilters()
- do_action( xmlrpc_call )action line 6790
- apply_filters( xmlrpc_text_filters )filter line 6799
wp_xmlrpc_server::mt_getTrackbackPings()
- do_action( xmlrpc_call )action line 6816
wp_xmlrpc_server::mt_publishPost()
- do_action( xmlrpc_call )action line 6873
wp_xmlrpc_server::pingback_ping()
- do_action( xmlrpc_call )action line 6917
- apply_filters( pingback_ping_source_uri )filter line 6933
- apply_filters( http_headers_useragent )filter line 7025
- apply_filters( pre_remote_source )filter line 7054
- do_action( pingback_post )action line 7152
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.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 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.