Title: wp_xmlrpc_server::__construct
Published: April 25, 2014
Last modified: August 20, 2026

---

# wp_xmlrpc_server::__construct()

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#wp--skip-link--target)

Registers all of the XMLRPC methods that XMLRPC server understands.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#description)󠁿

Sets up server and method property. Passes XMLRPC methods through the [‘xmlrpc_methods’](https://developer.wordpress.org/reference/hooks/xmlrpc_methods/)
filter to allow plugins to extend or replace XML-RPC methods.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#source)󠁿

    ```php
    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.
    		'wp.getCommentCount'               => 'this:wp_getCommentCount',
    		'wp.getPostStatusList'             => 'this:wp_getPostStatusList',
    		'wp.getPageStatusList'             => 'this:wp_getPageStatusList',
    		'wp.getPageTemplates'              => 'this:wp_getPageTemplates',
    		'wp.getOptions'                    => 'this:wp_getOptions',
    		'wp.setOptions'                    => 'this:wp_setOptions',
    		'wp.getComment'                    => 'this:wp_getComment',
    		'wp.getComments'                   => 'this:wp_getComments',
    		'wp.deleteComment'                 => 'this:wp_deleteComment',
    		'wp.editComment'                   => 'this:wp_editComment',
    		'wp.newComment'                    => 'this:wp_newComment',
    		'wp.getCommentStatusList'          => 'this:wp_getCommentStatusList',
    		'wp.getMediaItem'                  => 'this:wp_getMediaItem',
    		'wp.getMediaLibrary'               => 'this:wp_getMediaLibrary',
    		'wp.getPostFormats'                => 'this:wp_getPostFormats',
    		'wp.getPostType'                   => 'this:wp_getPostType',
    		'wp.getPostTypes'                  => 'this:wp_getPostTypes',
    		'wp.getRevisions'                  => 'this:wp_getRevisions',
    		'wp.restoreRevision'               => 'this:wp_restoreRevision',

    		// Blogger API.
    		'blogger.getUsersBlogs'            => 'this:blogger_getUsersBlogs',
    		'blogger.getUserInfo'              => 'this:blogger_getUserInfo',
    		'blogger.getPost'                  => 'this:blogger_getPost',
    		'blogger.getRecentPosts'           => 'this:blogger_getRecentPosts',
    		'blogger.newPost'                  => 'this:blogger_newPost',
    		'blogger.editPost'                 => 'this:blogger_editPost',
    		'blogger.deletePost'               => 'this:blogger_deletePost',

    		// MetaWeblog API (with MT extensions to structs).
    		'metaWeblog.newPost'               => 'this:mw_newPost',
    		'metaWeblog.editPost'              => 'this:mw_editPost',
    		'metaWeblog.getPost'               => 'this:mw_getPost',
    		'metaWeblog.getRecentPosts'        => 'this:mw_getRecentPosts',
    		'metaWeblog.getCategories'         => 'this:mw_getCategories',
    		'metaWeblog.newMediaObject'        => 'this:mw_newMediaObject',

    		/*
    		 * MetaWeblog API aliases for Blogger API.
    		 * See http://www.xmlrpc.com/stories/storyReader$2460
    		 */
    		'metaWeblog.deletePost'            => 'this:blogger_deletePost',
    		'metaWeblog.getUsersBlogs'         => 'this:blogger_getUsersBlogs',

    		// MovableType API.
    		'mt.getCategoryList'               => 'this:mt_getCategoryList',
    		'mt.getRecentPostTitles'           => 'this:mt_getRecentPostTitles',
    		'mt.getPostCategories'             => 'this:mt_getPostCategories',
    		'mt.setPostCategories'             => 'this:mt_setPostCategories',
    		'mt.supportedMethods'              => 'this:mt_supportedMethods',
    		'mt.supportedTextFilters'          => 'this:mt_supportedTextFilters',
    		'mt.getTrackbackPings'             => 'this:mt_getTrackbackPings',
    		'mt.publishPost'                   => 'this:mt_publishPost',

    		// Pingback.
    		'pingback.ping'                    => 'this:pingback_ping',
    		'pingback.extensions.getPingbacks' => 'this:pingback_extensions_getPingbacks',

    		'demo.sayHello'                    => 'this:sayHello',
    		'demo.addTwoNumbers'               => 'this:addTwoNumbers',
    	);

    	$this->initialise_blog_option_info();

    	/**
    	 * Filters the methods exposed by the XML-RPC server.
    	 *
    	 * This filter can be used to add new methods, and remove built-in methods.
    	 *
    	 * @since 1.5.0
    	 *
    	 * @param string[] $methods An array of XML-RPC methods, keyed by their methodName.
    	 */
    	$this->methods = apply_filters( 'xmlrpc_methods', $this->methods );

    	$this->set_is_enabled();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-xmlrpc-server.php#L69)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-xmlrpc-server.php#L69-L179)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#hooks)󠁿

 [apply_filters( ‘xmlrpc_methods’, string[] $methods )](https://developer.wordpress.org/reference/hooks/xmlrpc_methods/)

Filters the methods exposed by the XML-RPC server.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_xmlrpc_server::set_is_enabled()](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/set_is_enabled/)`wp-includes/class-wp-xmlrpc-server.php` |

Sets wp_xmlrpc_server::$is_enabled property.

  | 
| [wp_xmlrpc_server::initialise_blog_option_info()](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/initialise_blog_option_info/)`wp-includes/class-wp-xmlrpc-server.php` |

Sets up blog options property.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 1 more](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/?output_format=md#changelog)󠁿

| Version | Description | 
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_xmlrpc_server%2F__construct%2F)
before being able to contribute a note or feedback.