xmlrpc how to check for errors

Did you check your response ? in most of cases if its workable xmlrpc server it wil return you a faultCode and faultString. You also can setup your oun XMLRPC server (see xmlrpc.php wp_xmlrpc_server_class filter hook) to debug requests on a server side.

How to process shortcodes in XML-RPC

Explanation of the behavior A shortcode is meant to be processed during runtime (when rendering & displaying a post on the public facing view). It is absolutely not meant to be a pre-processor during saving the post. The receiver simply doesn’t have your parser (which is the function processing the shortcode) and therefore will get … Read more

Get Post meta via XML-RPC using wp.getPost

the filter xmlrpc_default_post_fields can modify the defult fields sent in rpc, but the defults array( ‘post’, ‘terms’, ‘custom_fields’ ) alredy include custom_fields you also have the filter xmlrpc_prepare_post, where you can add extra stuff to the rpc:s post

Do I need to instantiate the XMLRPC class or any class in another class to access its methods?

So far as I know, the XML RPC class is not instantiated unless needed, which is when the request is to /xmlrpc.php. You would instantiate the class the same way the Core does: include_once(ABSPATH . ‘wp-admin/includes/admin.php’); include_once(ABSPATH . WPINC . ‘/class-IXR.php’); include_once(ABSPATH . WPINC . ‘/class-wp-xmlrpc-server.php’); /** * Posts submitted via the XML-RPC interface get … Read more

Access post ID in “content_save_pre”

After asking around and looking for alternatives, I came up with a working solution that works in the web frontend and in the Android/iOS XML-RPC based apps. This is the filter. add_filter(‘wp_insert_post_data’, array($this, ‘save_content2’), 9, 2); I am pretty sure it is called before the content_save_pre filter. It allows direct access to the post fields … Read more

Checking for origin of a xmlrpc request

I guess there is $_SERVER[‘HTTP_ORIGIN’] property which can be helpful for this point, or even HTTP_REFERER, hooking into the init hook to make sure nothing runs until this origin is allowed, something like: add_action(“init”, function() { global $pagenow; if ( “xmlrpc.php” !== $pagenow ) return; // xmlrpc.php only $domains = array( “example.com” ); // domains … Read more

Cannot save underscore custom fields in one wordpress installation using xmlrpc and underscores

You have to unprotect meta to be able to access it with XML-RPC: <?php function my_unprotect_meta( $protected, $meta_key, $meta_type ) { if( ‘_al_listing_price’ == $meta_key ) { return false; } } add_filter( ‘is_protected_meta’, ‘my_unprotect_meta’, 10, 3 ); The solution you’ve mentioned in the comment to the question is ‘duct tape’ though it works. It completely … Read more

How do I disable XML-RPC in WordPress Multisite?

The simplest solution is a rule inside the .htaccess of the installation, if it is an Apache server. The following syntax should support you. Protect the whole access # PROTECT xmlrpc.php <Files xmlrpc.php> Order Allow,Deny Deny from all </Files> Access for several apps # ACCESS for xmlrpc surface only for different apps <IfModule mod_setenvif.c> <Files … Read more