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 = get_previously_saved_permalink(get_the_ID()); return $permalink? $permalink : $url; } That's not the problem (by the moment). The problem is, how to make the same with the metaWeblog.newPost function.
I've already tried something like this:
add_filter('xmlrpc_methods','xml_rpc_functions_to_add'); function xml_rpc_functions_to_add($args) { $args['metaWeblog.newPost'] = 'add_permalink'; return $args; } function add_permalink($args) { // Do it } What I need is to know how to call the previous 'metaWeblog.newPost' from 'add_permalink'.
get_previously_saved_permalink()to replace the standard link with one saved elsewhere (post meta perhaps). But now you're trying to hook in to save a different permalink via XMLRPC?