Getting the Posts’ permalinks from XLMRPC
Use the metaWeblog api instead: “metaWeblog.getRecentPosts”. This includes the permalink information. See here: http://mindsharestrategy.com/2010/wp-xmlrpc-metaweblog/
Use the metaWeblog api instead: “metaWeblog.getRecentPosts”. This includes the permalink information. See here: http://mindsharestrategy.com/2010/wp-xmlrpc-metaweblog/
The XML-RPC has a filter, where you can add your custom methods: function wpse60127_xmlrpc_methods( $methods ) { $methods[‘newWPSE60127Method’] = ‘wpse60127_new_method’; return $methods; } add_filter( ‘xmlrpc_methods’, ‘wpse60127_xmlrpc_methods’ ); Simply add your own methods there (core methods/functions) are also allowed.
turns out to be a libxml2 bug due to an old version on our server. Luckily a fix exits: the LibXML2-fix plugin.
You can also parse the feed with core functions and insert new post in the other install. You can write or buy a plugin for doing this. The important functions for this scenario is ‘fetch_feed’ and ‘wp_insert_post’. It is also useful, if you change the default cache, if you have often new posts, more as … Read more
From the save_post Codex page: save_post is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. So, if you hook into save_post you can run your filter before save: add_action( ‘save_post’, ‘wpse_75871_save_post’ ); function wpse_75871_save_post( $post_id ) { … Read more
Alright. I think I cracked it. <dateTime.iso8601>20140111T20:39:15</dateTime.iso8601> Should be: <dateTime.iso8601>20140111T20:39:15Z</dateTime.iso8601> Looks like the toolkit I was using didn’t quite implement iso8601 perfectly (or wordpress isn’t – not sure). I’m using Node WordPress and tracked down that it uses the module Node XML RPC to actually send the XML RPC. This seems to be where the … Read more
You can do it by sending the 5th parameter to wp.newPost, like this: $request = xmlrpc_encode_request( “wp.newPost”, array( 1, $xmlrpc_username, $xmlrpc_password, $content, $terms) ); Please note the $terms should be in this format: ‘Taxonomy names as keys, array of term IDs as values’, according to the Codex. FYI, here is another thread related to your … Read more
Using XML RPC to import data into WordPress
Figured it out. $post_obj[‘permalink’] = my_getDraftPermalink( $post_obj[‘post_id’] ); That’s the correct syntax for getting the post_id. Then a custom function that gets the permalink the same way as the post dashboard UI is required. The dashboard uses get_sample_permalink and not get_permalink, which will return the draft path if the post isn’t live. function my_getDraftPermalink ( … Read more
Custom xmlrpc request does not pass parameters?