Ejemplo n.º 1
0
 /**
  * The More Posts from Category.
  *
  * @param array $instance The settings for the particular instance of the widget.
  */
 public static function do_more_from_category($instance)
 {
     $posts_term = $instance['posts_term'];
     $taxonomy = $instance['taxonomy'];
     if (!empty($instance['more_from_category']) && !empty($posts_term['0'])) {
         ThemeMix_Featured_Content::action('thememix_featured_content_category_more', $instance);
         ThemeMix_Featured_Content::action('thememix_featured_content_taxonomy_more', $instance);
         ThemeMix_Featured_Content::action('thememix_featured_content_' . $taxonomy . '_more', $instance);
         $term = ThemeMix_Featured_Content::get_term_by('slug', $posts_term['1'], $taxonomy);
         $link = $instance['archive_link'] ? $instance['archive_link'] : esc_url(get_term_link($posts_term['1'], $taxonomy));
         printf('<p class="more-from-%1$s"><a href="%2$s" title="%3$s">%4$s</a></p>', $taxonomy, $link, esc_attr($term->name), esc_html($instance['more_from_category_text']));
     }
     ThemeMix_Featured_Content::action('thememix_featured_content_after_category_more', $instance);
     ThemeMix_Featured_Content::action('thememix_featured_content_after_taxonomy_more', $instance);
     ThemeMix_Featured_Content::action('thememix_featured_content_after_' . $taxonomy . '_more', $instance);
 }