Ejemplo n.º 1
0
 /**
  * Retrieves taxonomy terms and can apply urls
  * @since 0.1.0
  * @param string|array $taxonomies
  * @return array|WP_Error
  */
 public function terms($taxonomies)
 {
     // Retrieve terms
     $terms = wp_get_post_terms($this->id, $taxonomies);
     if (is_wp_error($terms)) {
         return $terms;
     }
     $controllers = array();
     foreach ($terms as $term) {
         $controllers[] = Term::get_controller($term);
     }
     return $controllers;
 }
Ejemplo n.º 2
0
 /**
  * Global function to call Term::get_controller
  * @see Term::get_controller
  */
 function get_term_controller($key = null, $taxonomy = null, $field = 'id', $options = array())
 {
     return Term::get_controller($key, $taxonomy, $field, $options);
 }