letrunghieu / wordpress-xmlrpc-client

A PHP XML-RPC client for Wordpress websites
MIT License
117 stars 42 forks source link

How to add tags to a post? #14

Closed soisme closed 9 years ago

soisme commented 9 years ago

I tried the following they don't work.

$wpClient->newPost($title, $message, array('terms' => array('category' => array($category)), 'mt_keywords' => 'tag'));

$wpClient->newPost($title, $message, array('terms' => array('category' => array($category)), 'mt_keywords' => array('tag')));

soisme commented 9 years ago

Oh just figured it out when I read http://codex.wordpress.org/Function_Reference/wp_insert_post

    $wp_post_id = $wpClient->newPost($title, $message, array('terms' => array('category' => array($category)), 'tags_input' => 'tag1, tag2' ));
katona44 commented 8 years ago

Could you give an example how it works in the new version? Been trying to figure it out for hours.