Is it possible to check (via php) is XML-RPC enabled in WordPress? Something like, to write a function which will test this.
if(is_xmlrpc_enabled()) {
//action
}
else {
//another action
}
XML-RPC is enabled by default for WP versions > 3.5 (with 'xmlrpc_enabled' hook which allow to disable it) For older versions, there is a field in the database (options table), which indicates if it is enabled or not.(This option is removed for wp > 3.5)
function is_xmlrpc_enabled() {
$returnBool = false;
$enabled = get_option('enable_xmlrpc'); //for ver<3.5
if($enabled) {
$returnBool = true;
}
else {
global $wp_version;
if (version_compare($wp_version, '3.5', '>=')) {
$returnBool = true; //its on by default for versions above 3.5
}
else {
$returnBool = false;
}
}
return $returnBool;
}