Store source permalink on XMLRPC calls

In a theme I’m developing, I need to link to the source post when the post has been stored using XMLRPC. That implies that every time WordPress asks for a permalink (using get_permalink()) the theme will return a previously saved link. That’s accomplished by adding a new filter: add_action(‘the_permalink’, ‘filterPermalink’); function filterPermalink($url) { $permalink = … Read more

XML-RPC: Add category to post data

I have a service that puts a daily post to my blog via XML-RPC. It doesn’t offer me any control of what category it goes into so I want to just add a filter/hook to add the category I want into the incoming post data: add_action (‘xmlrpc_call’, ‘check_xmlrpc_call’ ); function check_xmlrpc_call( $method ) { if( … Read more

X-Pingback and XMLRPC

According to old post: How to secure WordPress XMLRPC?, every API require authentication. So, what is the point of adding X-Pingback in every public request? curl -I http://ma.tt .. X-Pingback: http://ma.tt/blog/xmlrpc.php Content-Type: text/html; charset=UTF-8 .. 1 Answer 1 I think that when talking about XMLRPC in the context of wordpress you usually mean to talk … Read more

Extending xml rpc – best practice

I need to add custom methods to the Xml-Rpc file and have found the following: // Custom plugins add_filter(‘xmlrpc_methods’, ‘custom_xmlrpc_methods’); function custom_xmlrpc_methods($methods) { $methods[‘myMethod’] = ‘my_function’; return $methods; } Questions: Is it possible to have the callback function in another file and if yes then how do you do that in the code? If I … Read more

custom XMLRPC method plus authentication of user & WooCommerce order

I’m working with a custom XML-RPC method to capture some information for a plugin I am building. When activated the user has to authenticate themselves by entering there user/password given to them when purchasing the plugin on my WP site. The plugin uses this code: if ( isset( $_POST[‘username’] ) && isset( $_POST[‘password’] ) ) … Read more