blogapi_mt_set_post_categories
- Versions
- 4.6 – 6
blogapi_mt_set_post_categories($postid, $username, $password, $categories)
Blogging API callback. Assigns taxonomy terms to a particular node.
Code
modules/blogapi.module, line 425
<?php
function blogapi_mt_set_post_categories($postid, $username, $password, $categories) {
$user = blogapi_validate_user($username, $password);
if (!$user->uid) {
return blogapi_error($user);
}
$nid = $postid;
$terms = array();
foreach ($categories as $category) {
$terms[] = $category['categoryId'];
}
module_invoke('taxonomy', 'node_save', $nid, $terms);
return true;
}
?>Login or register to post comments 