function fleeds_series_list_related($args = array()) { if (!function_exists('series_list_related')) { return false; } if (empty($args['title'])) { $args['title'] = __('In the same series as:', 'fleeds'); } $title = apply_filters('fleeds_series_title', $args['title']); $before = apply_filters('fleeds_series_before', '<div class="fleeds-series-box widget">'); $after = apply_filters('fleeds_series_after', '</div>'); $before_title = apply_filters('fleeds_series_before_title', '<h6 class="fleeds-series-title">'); $after_title = apply_filters('fleeds_series_after_title', '</h6>'); if (!isset($args['echo'])) { $args['echo'] = false; } if ($series_list = series_list_related($args)) { echo $before; echo $before_title . $title . $after_title; echo $series_list; echo $after; } else { return false; } }
/** * Outputs the widget based on the arguments input through the widget controls. * * @since 0.2.0 * @access public * @return void */ public function widget($sidebar, $instance) { extract($sidebar); /* Set up the arguments. */ $args = array('order' => !empty($instance['order']) ? $instance['order'] : 'ASC', 'orderby' => !empty($instance['orderby']) ? $instance['orderby'] : 'date', 'posts_per_page' => !empty($instance['posts_per_page']) ? $instance['posts_per_page'] : -1, 'echo' => false); /* Get the series list. */ $list = series_list_related($args); /* Only display if we have a series. */ if (empty($list)) { return; } /* Output the theme's widget wrapper. */ echo $before_widget; /* If a title was input by the user, display it. */ if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title; } /* Output the list. */ echo $list; /* Close the theme's widget wrapper. */ echo $after_widget; }