Ejemplo n.º 1
0
 /**
  * @param array $args
  *
  * @return mixed|null
  */
 function the_comments_html($args = array())
 {
     if (!$this->has_post()) {
         $comments_html = null;
     } else {
         $args = wp_parse_args($args, array('template_file' => '/comments.php', 'group_by_type' => false));
         WPLib::push_post($this->model()->post());
         comments_template($args['template_file'], $args['group_by_type']);
         WPLib::pop_post();
     }
     return $comments_html;
 }
Ejemplo n.º 2
0
 /**
  * @param array $args
  *
  * @return mixed|null
  */
 function get_adjacent_post($args = array())
 {
     if (!$this->has_post()) {
         $adjacent_post = null;
     } else {
         $args = wp_parse_args($args, array('in_same_term' => false, 'excluded_terms' => '', 'taxonomy' => 'category', 'previous' => null));
         WPLib::push_post($this->_post);
         $adjacent_post = get_adjacent_post($args['in_same_term'], $args['excluded_terms'], $args['previous'], $args['taxonomy']);
         WPLib::pop_post();
     }
     return $adjacent_post;
 }