/**
  * Find one term by id
  * @param $termId int
  * @return WP_Term
  */
 public function findOne($termId)
 {
     $term = get_term($termId, static::$associate_post_type);
     return Hydratator::hydrate($term, static::$fields, static::$depth);
 }
Esempio n. 2
0
 /**
  * Find one page by ID and hydrate it
  * @param $pageId int ID of the page to retrieve
  */
 public function findOne($pageId)
 {
     $page = get_post($pageId);
     return Hydratator::hydrate($page, static::$fields, static::$depth);
 }