Skip to content

Instantly share code, notes, and snippets.

@jhaus
Created December 4, 2010 23:46
Show Gist options
  • Save jhaus/728610 to your computer and use it in GitHub Desktop.
Save jhaus/728610 to your computer and use it in GitHub Desktop.
remotely edit wordpress posts via: http://bit.ly/gyHw5K
<?php
// Update a Selected Post
$title= "Updated Title"; // The Title of the Post
$bodycontent="Updated Blog Article Content"; // Article Content
$categoriesu= array('Category1', 'Category2'); // Pre Existing Categories - Updated
$tagsu="tag1, tag2, $tag3"; // Updated Tags
$content = array('title'=>$title, 'description'=>$bodycontent,'categories'=>$categoriesu,'mt_keywords'=>$tagsu);
$params = array(163,$username,$password,$content,1); // First Parameter is mandatory Post Id (get your post id via Recent Blogs entries)
// Run a query for PHP
if (!$client->query('metaWeblog.editPost', $params)) {
die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage());
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment