I created the elWpAPIwrap class as a special object that has as methods all WordPress functions (some may not be of use). I processed them automatically and added them to this object to automate the rFC with it. So, it's basically a wrapper for rFC (Remote Function Calls) that will help your PHP editor provide syntax support for WordPress functions even when working outside of WordPress.
It's of great use to me and I'm sure it will also be to you.
1 | Instantiating elWpAPIwrap()
<?php
// Include WPAPI files first
require_once(dirname(__FILE__).'/wpapi/WpAPI.php');
require_once(dirname(__FILE__).'/wpapi/WpAPIpro.php');
require_once(dirname(__FILE__).'/wpapi/WpAPIwrap.php');
// Using the basic Object (enter proper blog URL and Credentials)
$wp = new elWpAPI('http://.../xmlrpc.php', 'admin', 'password');
// ... or the Advanced Object (that requires rFC/rSQL MUplugin installed)
$wpro = new elWpAPIpro('http://.../xmlrpc.php', 'admin', 'password');
// And only when you have $wp or $wpro ready, you instantiate the Wrap()
$wrap = new elWpAPIwrap($wp); // works with $wpro also
?>
2 | Creating and Removing a Post
<?php
// This is how easy it is to create a post with native WP API.
// It's the same as using wp_insert_post() when writing Plugins.
$postID = $wrap->Wp_Insert_Post(array(
'post_title' => 'Title1',
'post_content' => 'Text1',
'post_status' => 'publish',
));
// And this is how you delete it.
if(is_numeric($postID)){
$wrap->Wp_Delete_Post($postID, true);
}
?>


