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 195
- apply_filters( option_enable_xmlrpc )filter line 198
- apply_filters( xmlrpc_enabled )filter line 223
wp_xmlrpc_server::login()
- apply_filters( xmlrpc_login_error )filter line 325
wp_xmlrpc_server::wp_getUsersBlogs()
- do_action( xmlrpc_call )action line 752
wp_xmlrpc_server::wp_newPost()
- do_action( xmlrpc_call )action line 1366
wp_xmlrpc_server::wp_editPost()
- do_action( xmlrpc_call )action line 1767
wp_xmlrpc_server::wp_deletePost()
- do_action( xmlrpc_call )action line 1850
wp_xmlrpc_server::wp_getPost()
- apply_filters( xmlrpc_default_post_fields )filter line 1942
- do_action( xmlrpc_call )action line 1951
wp_xmlrpc_server::wp_getPosts()
- apply_filters( xmlrpc_default_post_fields )filter line 2003
- do_action( xmlrpc_call )action line 2012
wp_xmlrpc_server::wp_newTerm()
- do_action( xmlrpc_call )action line 2111
wp_xmlrpc_server::wp_editTerm()
- do_action( xmlrpc_call )action line 2216
wp_xmlrpc_server::wp_deleteTerm()
- do_action( xmlrpc_call )action line 2334
wp_xmlrpc_server::wp_getTerm()
- do_action( xmlrpc_call )action line 2413
wp_xmlrpc_server::wp_getTerms()
- do_action( xmlrpc_call )action line 2478
wp_xmlrpc_server::wp_getTaxonomy()
- apply_filters( xmlrpc_default_taxonomy_fields )filter line 2576
- do_action( xmlrpc_call )action line 2585
wp_xmlrpc_server::wp_getTaxonomies()
- apply_filters( xmlrpc_default_taxonomy_fields )filter line 2634
- do_action( xmlrpc_call )action line 2643
wp_xmlrpc_server::wp_getUser()
- apply_filters( xmlrpc_default_user_fields )filter line 2720
- do_action( xmlrpc_call )action line 2729
wp_xmlrpc_server::wp_getUsers()
- apply_filters( xmlrpc_default_user_fields )filter line 2783
- do_action( xmlrpc_call )action line 2792
wp_xmlrpc_server::wp_getProfile()
- apply_filters( xmlrpc_default_user_fields )filter line 2863
- do_action( xmlrpc_call )action line 2872
wp_xmlrpc_server::wp_editProfile()
- do_action( xmlrpc_call )action line 2922
wp_xmlrpc_server::wp_getPage()
- do_action( xmlrpc_call )action line 3011
wp_xmlrpc_server::wp_getPages()
- do_action( xmlrpc_call )action line 3054
wp_xmlrpc_server::wp_newPage()
- do_action( xmlrpc_call )action line 3109
wp_xmlrpc_server::wp_deletePage()
- do_action( xmlrpc_call )action line 3146
- do_action( xmlrpc_call_success_wp_deletePage )action line 3176
wp_xmlrpc_server::wp_editPage()
- do_action( xmlrpc_call )action line 3215
wp_xmlrpc_server::wp_getPageList()
- do_action( xmlrpc_call )action line 3278
wp_xmlrpc_server::wp_getAuthors()
- do_action( xmlrpc_call )action line 3339
wp_xmlrpc_server::wp_getTags()
- do_action( xmlrpc_call )action line 3383
wp_xmlrpc_server::wp_newCategory()
- do_action( xmlrpc_call )action line 3433
- do_action( xmlrpc_call_success_wp_newCategory )action line 3487
wp_xmlrpc_server::wp_deleteCategory()
- do_action( xmlrpc_call )action line 3520
- do_action( xmlrpc_call_success_wp_deleteCategory )action line 3537
wp_xmlrpc_server::wp_suggestCategories()
- do_action( xmlrpc_call )action line 3577
wp_xmlrpc_server::wp_getComment()
- do_action( xmlrpc_call )action line 3623
wp_xmlrpc_server::wp_getComments()
- do_action( xmlrpc_call )action line 3679
wp_xmlrpc_server::wp_deleteComment()
- do_action( xmlrpc_call )action line 3770
- do_action( xmlrpc_call_success_wp_deleteComment )action line 3783
wp_xmlrpc_server::wp_editComment()
- do_action( xmlrpc_call )action line 3838
- do_action( xmlrpc_call_success_wp_editComment )action line 3896
wp_xmlrpc_server::wp_newComment()
- apply_filters( xmlrpc_allow_anonymous_comments )filter line 3933
- apply_filters( allow_empty_comment )filter line 4025
- do_action( xmlrpc_call )action line 4032
- do_action( xmlrpc_call_success_wp_newComment )action line 4051
wp_xmlrpc_server::wp_getCommentCount()
- do_action( xmlrpc_call )action line 4128
wp_xmlrpc_server::wp_getPostStatusList()
- do_action( xmlrpc_call )action line 4170
wp_xmlrpc_server::wp_getPageStatusList()
- do_action( xmlrpc_call )action line 4205
wp_xmlrpc_server::wp_getMediaItem()
- do_action( xmlrpc_call )action line 4398
wp_xmlrpc_server::wp_getMediaLibrary()
- do_action( xmlrpc_call )action line 4454
wp_xmlrpc_server::wp_getPostFormats()
- do_action( xmlrpc_call )action line 4510
wp_xmlrpc_server::wp_getPostType()
- apply_filters( xmlrpc_default_posttype_fields )filter line 4582
- do_action( xmlrpc_call )action line 4591
wp_xmlrpc_server::wp_getPostTypes()
- apply_filters( xmlrpc_default_posttype_fields )filter line 4639
- do_action( xmlrpc_call )action line 4648
wp_xmlrpc_server::wp_getRevisions()
- apply_filters( xmlrpc_default_revision_fields )filter line 4710
- do_action( xmlrpc_call )action line 4719
wp_xmlrpc_server::wp_restoreRevision()
- do_action( xmlrpc_call )action line 4793
wp_xmlrpc_server::blogger_getUserInfo()
- do_action( xmlrpc_call )action line 4948
wp_xmlrpc_server::blogger_getPost()
- do_action( xmlrpc_call )action line 4998
wp_xmlrpc_server::blogger_newPost()
- do_action( xmlrpc_call )action line 5145
- do_action( xmlrpc_call_success_blogger_newPost )action line 5192
wp_xmlrpc_server::blogger_editPost()
- do_action( xmlrpc_call )action line 5230
- do_action( xmlrpc_call_success_blogger_editPost )action line 5271
wp_xmlrpc_server::blogger_deletePost()
- do_action( xmlrpc_call )action line 5304
- do_action( xmlrpc_call_success_blogger_deletePost )action line 5330
wp_xmlrpc_server::mw_newPost()
- do_action( xmlrpc_call )action line 5392
- do_action( xmlrpc_call_success_mw_newPost )action line 5700
wp_xmlrpc_server::mw_editPost()
- do_action( xmlrpc_call )action line 5788
- do_action( xmlrpc_call_success_mw_editPost )action line 6107
wp_xmlrpc_server::mw_getPost()
- do_action( xmlrpc_call )action line 6148
wp_xmlrpc_server::mw_getRecentPosts()
- do_action( xmlrpc_call )action line 6289
wp_xmlrpc_server::mw_getCategories()
- do_action( xmlrpc_call )action line 6410
wp_xmlrpc_server::mw_newMediaObject()
- do_action( xmlrpc_call )action line 6476
- apply_filters( pre_upload_error )filter line 6524
- do_action( xmlrpc_call_success_mw_newMediaObject )action line 6567
wp_xmlrpc_server::mt_getCategoryList()
- do_action( xmlrpc_call )action line 6678
wp_xmlrpc_server::mt_getPostCategories()
- do_action( xmlrpc_call )action line 6736
wp_xmlrpc_server::mt_setPostCategories()
- do_action( xmlrpc_call )action line 6783
wp_xmlrpc_server::mt_supportedMethods()
- do_action( xmlrpc_call )action line 6812
wp_xmlrpc_server::mt_supportedTextFilters()
- do_action( xmlrpc_call )action line 6824
- apply_filters( xmlrpc_text_filters )filter line 6833
wp_xmlrpc_server::mt_getTrackbackPings()
- do_action( xmlrpc_call )action line 6850
wp_xmlrpc_server::mt_publishPost()
- do_action( xmlrpc_call )action line 6907
wp_xmlrpc_server::pingback_ping()
- do_action( xmlrpc_call )action line 6951
- apply_filters( pingback_ping_source_uri )filter line 6967
- apply_filters( http_headers_useragent )filter line 7059
- apply_filters( pre_remote_source )filter line 7088
- do_action( pingback_post )action line 7186
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 7.1.0 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.