How to validate XML-RPC post creation and cancel when needed?

It looks like the xmlrpc_prepare_post filter is only applied to the output of the wp_getPost and wp_getRevision methods of the wp_xmlrpc_server class. It would be great if this code line: do_action( ‘xmlrpc_call’, ‘wp.newPost’ ); would be replaced with extra input arguments, for example: do_action( ‘xmlrpc_call’, ‘wp.newPost’, …, $content_struct ); but that’s not going to happen … Read more

WordPress as XML-RPC client?

WordPress already has a XML-RPC client class implemented. It’s in the same file as the server part: class-IXR.php located in wp-includes. The following code will generate a new post. You could wrap this in a function and attach it to the save_post/update_post action hook. To sync both parts, you could check for the post-slug or … Read more

Best way to eliminate xmlrpc.php?

Since WordPress 3.5 this option (XML-RPC) is enabled by default, and the ability to turn it off from WordPress dashboard is gone. Add this code snippet for use in functions.php: // Disable use XML-RPC add_filter( ‘xmlrpc_enabled’, ‘__return_false’ ); // Disable X-Pingback to header add_filter( ‘wp_headers’, ‘disable_x_pingback’ ); function disable_x_pingback( $headers ) { unset( $headers[‘X-Pingback’] ); … Read more

Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC)

Changing the memory_limit by ini_set(‘memory_limit’, ‘-1′); is not a proper solution. Please don’t do that. Your PHP code may have a memory leak somewhere and you are telling the server to just use all the memory that it wants. You wouldn’t have fixed the problem at all. If you monitor your server, you will see that it is now probably using … Read more