• mellett

    (@mellett)


    What class/file should I install the function and add_filter() call in order to intercept the post request?

    I’ve tried a number of areas, some don’t get called at all, others don’t have the data that I’m looking for (xmlrpc.php).

    Does there also need to be a call to apply_filters(), before the function will be called? The problem I’m running into is that I don’t think that the _insert_post() function of class-wp-xmlrpc-server.php is ever called which is the only place that I’ve found an apply_filters() call for ‘xmlrpc_wp_insert_post_data’.

    I’d appreciate any thoughts or suggestions because as it stands right now I’m just chasing my tail.

    Thanks
    Andy

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    ‘xmlrpc_wp_insert_post_data’ is the right filter for posts inserted via XML-RPC. You can add your filter callback on your theme’s functions.php, but your code could be overwritten when the theme updates. To prevent this, create a child theme or a simple plugin to contain your code.

    You do not need to call apply_filters(), add_filter() is the only function you need to call, plus whatever you do in the filter callback function. Be sure your callback returns the post data array to use in the insertion.

    If you still have trouble, post the code you’re using and someone should be able to spot the problem.

Viewing 1 replies (of 1 total)

The topic ‘xmlrpc_wp_insert_post_data help/examples’ is closed to new replies.