blogapi_metaweblog_get_category_list

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/blogapi/blogapi.module, строка 463

Версии
5 – 6
blogapi_metaweblog_get_category_list($blogid, $username, $password)

Коллбэк Blogging API. Возвращает список терминов таксономии. которые могут быть связаны с данной записью блога.

Код

<?php
function blogapi_metaweblog_get_category_list($blogid, $username, $password) {
  $type = _blogapi_blogid($blogid);
  $vocabularies = module_invoke('taxonomy', 'get_vocabularies', $type, 'vid');
  $categories = array();
  if ($vocabularies) {
    foreach ($vocabularies as $vocabulary) {
      $terms = module_invoke('taxonomy', 'get_tree', $vocabulary->vid, 0, -1);
      foreach ($terms as $term) {
        $term_name = $term->name;
        foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) {
          $term_name = $parent->name .'/'. $term_name;
        }
        $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid);
      }
    }
  }
  return $categories;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему