-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisable-the-xml-rpc.php
64 lines (54 loc) · 1.45 KB
/
disable-the-xml-rpc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/*
Plugin Name: Disable The XML-RPC
Plugin URI: https://github.com/emkopic/disable-the-xml-rpc
Description: This plugin disables XML-RPC API in WordPress which is enabled by default.
Version: 1.0
Author: Emir
Author URI: https://github.com/emkopic
License: GPLv2
*/
add_filter( 'wp_xmlrpc_server_class', 'emko_wp_xmlrpc_server_class' );
function emko_wp_xmlrpc_server_class() {
return 'emko_wp_xmlrpc_server';
}
require_once(ABSPATH . WPINC . '/class-IXR.php');
class emko_wp_xmlrpc_server extends IXR_Server {
/**
* Register all of the XMLRPC methods that XMLRPC server understands.
*
* Sets up server and method property. Passes XMLRPC
* methods through the 'xmlrpc_methods' filter to allow plugins to extend
* or replace XMLRPC methods.
*
* @since 1.5.0
*
* @return wp_xmlrpc_server
*/
function __construct() {
$this->methods = array(
// PingBack
'pingback.ping' => 'this:pingback_ping',
'pingback.extensions.getPingbacks' => 'this:pingback_extensions_getPingbacks',
'demo.sayMyName' => 'this:sayMyName',
'demo.addWhatsUp' => 'this:addWhatsUp'
);
$this->initialise_blog_option_info();
$this->methods = apply_filters('xmlrpc_methods', $this->methods);
}
function serve_request() {
}
/**
* Set up blog options property.
*
* Passes property through 'xmlrpc_blog_options' filter.
*
* @since 2.6.0
*/
function initialise_blog_option_info() {
global $wp_version;
$this->blog_options = array(
);
}
}
?>