blogapi_mt_set_post_categories
Definition
blogapi_mt_set_post_categories($postid, $username, $password, $categories)
modules/blogapi/blogapi.module, line 500
Description
Blogging API callback. Assigns taxonomy terms to a particular node.
Code
<?php
function blogapi_mt_set_post_categories($postid, $username, $password, $categories) {
$user = blogapi_validate_user($username, $password);
if (!$user->uid) {
return blogapi_error($user);
}
$node = node_load($postid);
$node->taxonomy = array();
foreach ($categories as $category) {
$node->taxonomy[] = $category['categoryId'];
}
node_save($node);
return TRUE;
}
?> 