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 314
wp_xmlrpc_server::wp_getUsersBlogs()
- do_action( xmlrpc_call )action line 736
wp_xmlrpc_server::wp_newPost()
- do_action( xmlrpc_call )action line 1347
wp_xmlrpc_server::wp_editPost()
- do_action( xmlrpc_call )action line 1748
wp_xmlrpc_server::wp_deletePost()
- do_action( xmlrpc_call )action line 1831
wp_xmlrpc_server::wp_getPost()
- apply_filters( xmlrpc_default_post_fields )filter line 1923
- do_action( xmlrpc_call )action line 1932
wp_xmlrpc_server::wp_getPosts()
- apply_filters( xmlrpc_default_post_fields )filter line 1984
- do_action( xmlrpc_call )action line 1993
wp_xmlrpc_server::wp_newTerm()
- do_action( xmlrpc_call )action line 2092
wp_xmlrpc_server::wp_editTerm()
- do_action( xmlrpc_call )action line 2197
wp_xmlrpc_server::wp_deleteTerm()
- do_action( xmlrpc_call )action line 2313
wp_xmlrpc_server::wp_getTerm()
- do_action( xmlrpc_call )action line 2392
wp_xmlrpc_server::wp_getTerms()
- do_action( xmlrpc_call )action line 2457
wp_xmlrpc_server::wp_getTaxonomy()
- apply_filters( xmlrpc_default_taxonomy_fields )filter line 2555
- do_action( xmlrpc_call )action line 2564
wp_xmlrpc_server::wp_getTaxonomies()
- apply_filters( xmlrpc_default_taxonomy_fields )filter line 2613
- do_action( xmlrpc_call )action line 2622
wp_xmlrpc_server::wp_getUser()
- apply_filters( xmlrpc_default_user_fields )filter line 2699
- do_action( xmlrpc_call )action line 2708
wp_xmlrpc_server::wp_getUsers()
- apply_filters( xmlrpc_default_user_fields )filter line 2762
- do_action( xmlrpc_call )action line 2771
wp_xmlrpc_server::wp_getProfile()
- apply_filters( xmlrpc_default_user_fields )filter line 2842
- do_action( xmlrpc_call )action line 2851
wp_xmlrpc_server::wp_editProfile()
- do_action( xmlrpc_call )action line 2901
wp_xmlrpc_server::wp_getPage()
- do_action( xmlrpc_call )action line 2990
wp_xmlrpc_server::wp_getPages()
- do_action( xmlrpc_call )action line 3033
wp_xmlrpc_server::wp_newPage()
- do_action( xmlrpc_call )action line 3088
wp_xmlrpc_server::wp_deletePage()
- do_action( xmlrpc_call )action line 3125
- do_action( xmlrpc_call_success_wp_deletePage )action line 3155
wp_xmlrpc_server::wp_editPage()
- do_action( xmlrpc_call )action line 3194
wp_xmlrpc_server::wp_getPageList()
- do_action( xmlrpc_call )action line 3257
wp_xmlrpc_server::wp_getAuthors()
- do_action( xmlrpc_call )action line 3318
wp_xmlrpc_server::wp_getTags()
- do_action( xmlrpc_call )action line 3362
wp_xmlrpc_server::wp_newCategory()
- do_action( xmlrpc_call )action line 3412
- do_action( xmlrpc_call_success_wp_newCategory )action line 3466
wp_xmlrpc_server::wp_deleteCategory()
- do_action( xmlrpc_call )action line 3499
- do_action( xmlrpc_call_success_wp_deleteCategory )action line 3516
wp_xmlrpc_server::wp_suggestCategories()
- do_action( xmlrpc_call )action line 3556
wp_xmlrpc_server::wp_getComment()
- do_action( xmlrpc_call )action line 3602
wp_xmlrpc_server::wp_getComments()
- do_action( xmlrpc_call )action line 3658
wp_xmlrpc_server::wp_deleteComment()
- do_action( xmlrpc_call )action line 3753
- do_action( xmlrpc_call_success_wp_deleteComment )action line 3766
wp_xmlrpc_server::wp_editComment()
- do_action( xmlrpc_call )action line 3821
- do_action( xmlrpc_call_success_wp_editComment )action line 3878
wp_xmlrpc_server::wp_newComment()
- apply_filters( xmlrpc_allow_anonymous_comments )filter line 3915
- apply_filters( allow_empty_comment )filter line 4007
- do_action( xmlrpc_call )action line 4014
- do_action( xmlrpc_call_success_wp_newComment )action line 4033
wp_xmlrpc_server::wp_getCommentCount()
- do_action( xmlrpc_call )action line 4110
wp_xmlrpc_server::wp_getPostStatusList()
- do_action( xmlrpc_call )action line 4152
wp_xmlrpc_server::wp_getPageStatusList()
- do_action( xmlrpc_call )action line 4187
wp_xmlrpc_server::wp_getMediaItem()
- do_action( xmlrpc_call )action line 4380
wp_xmlrpc_server::wp_getMediaLibrary()
- do_action( xmlrpc_call )action line 4436
wp_xmlrpc_server::wp_getPostFormats()
- do_action( xmlrpc_call )action line 4492
wp_xmlrpc_server::wp_getPostType()
- apply_filters( xmlrpc_default_posttype_fields )filter line 4564
- do_action( xmlrpc_call )action line 4573
wp_xmlrpc_server::wp_getPostTypes()
- apply_filters( xmlrpc_default_posttype_fields )filter line 4621
- do_action( xmlrpc_call )action line 4630
wp_xmlrpc_server::wp_getRevisions()
- apply_filters( xmlrpc_default_revision_fields )filter line 4692
- do_action( xmlrpc_call )action line 4701
wp_xmlrpc_server::wp_restoreRevision()
- do_action( xmlrpc_call )action line 4775
wp_xmlrpc_server::blogger_getUserInfo()
- do_action( xmlrpc_call )action line 4930
wp_xmlrpc_server::blogger_getPost()
- do_action( xmlrpc_call )action line 4980
wp_xmlrpc_server::blogger_newPost()
- do_action( xmlrpc_call )action line 5127
- do_action( xmlrpc_call_success_blogger_newPost )action line 5166
wp_xmlrpc_server::blogger_editPost()
- do_action( xmlrpc_call )action line 5204
- do_action( xmlrpc_call_success_blogger_editPost )action line 5245
wp_xmlrpc_server::blogger_deletePost()
- do_action( xmlrpc_call )action line 5278
- do_action( xmlrpc_call_success_blogger_deletePost )action line 5304
wp_xmlrpc_server::mw_newPost()
- do_action( xmlrpc_call )action line 5366
- do_action( xmlrpc_call_success_mw_newPost )action line 5655
wp_xmlrpc_server::mw_editPost()
- do_action( xmlrpc_call )action line 5743
- do_action( xmlrpc_call_success_mw_editPost )action line 6039
wp_xmlrpc_server::mw_getPost()
- do_action( xmlrpc_call )action line 6080
wp_xmlrpc_server::mw_getRecentPosts()
- do_action( xmlrpc_call )action line 6221
wp_xmlrpc_server::mw_getCategories()
- do_action( xmlrpc_call )action line 6342
wp_xmlrpc_server::mw_newMediaObject()
- do_action( xmlrpc_call )action line 6399
- apply_filters( pre_upload_error )filter line 6428
- do_action( xmlrpc_call_success_mw_newMediaObject )action line 6469
wp_xmlrpc_server::mt_getCategoryList()
- do_action( xmlrpc_call )action line 6580
wp_xmlrpc_server::mt_getPostCategories()
- do_action( xmlrpc_call )action line 6638
wp_xmlrpc_server::mt_setPostCategories()
- do_action( xmlrpc_call )action line 6685
wp_xmlrpc_server::mt_supportedMethods()
- do_action( xmlrpc_call )action line 6714
wp_xmlrpc_server::mt_supportedTextFilters()
- do_action( xmlrpc_call )action line 6726
- apply_filters( xmlrpc_text_filters )filter line 6735
wp_xmlrpc_server::mt_getTrackbackPings()
- do_action( xmlrpc_call )action line 6752
wp_xmlrpc_server::mt_publishPost()
- do_action( xmlrpc_call )action line 6809
wp_xmlrpc_server::pingback_ping()
- do_action( xmlrpc_call )action line 6853
- apply_filters( pingback_ping_source_uri )filter line 6869
- apply_filters( http_headers_useragent )filter line 6960
- apply_filters( pre_remote_source )filter line 6989
- do_action( pingback_post )action line 7087
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.7.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.