/** * Displays the output, the view list * * @since bbPress (r3020) * * @param mixed $args Arguments * @param array $instance Instance * @uses apply_filters() Calls 'bbp_view_widget_title' with the title * @uses bbp_get_views() To get the views * @uses bbp_view_url() To output the view url * @uses bbp_view_title() To output the view title */ public function widget($args, $instance) { // Only output widget contents if views exist if (bbp_get_views()) { extract($args); $title = apply_filters('bbp_view_widget_title', $instance['title']); echo $before_widget; echo $before_title . $title . $after_title; ?> <ul> <?php foreach (bbp_get_views() as $view => $args) { ?> <li><a class="bbp-view-title" href="<?php bbp_view_url($view); ?> " title="<?php bbp_view_title($view); ?> "><?php bbp_view_title($view); ?> </a></li> <?php } ?> </ul> <?php echo $after_widget; } }
<div id="bbp-view-<?php bbp_view_id(); ?> " class="bbp-view<?php if (is_active_sidebar('sidebar_forum')) { echo ' col-md-9'; } else { echo ' col-md-12'; } ?> "> <section class="new-content"> <div class="box-post"> <div class="inner-box"> <h1 class="entry-title page-title clearfix"><span><?php bbp_view_title(); ?> </span></h1> <div class="entry-content"> <?php bbp_get_template_part('content', 'single-view'); ?> </div> </div> </div> </section> </div><!-- #topic-front --> <?php
/** * Displays the output, the view list * * @since bbPress (r3020) * * @param mixed $args Arguments * @param array $instance Instance * @uses apply_filters() Calls 'bbp_view_widget_title' with the title * @uses bbp_get_views() To get the views * @uses bbp_view_url() To output the view url * @uses bbp_view_title() To output the view title */ public function widget($args = array(), $instance = array()) { // Only output widget contents if views exist if (!bbp_get_views()) { return; } // Get widget settings $settings = $this->parse_settings($instance); // Typical WordPress filter $settings['title'] = apply_filters('widget_title', $settings['title'], $instance, $this->id_base); // bbPress filter $settings['title'] = apply_filters('bbp_view_widget_title', $settings['title'], $instance, $this->id_base); echo $args['before_widget']; if (!empty($settings['title'])) { echo $args['before_title'] . $settings['title'] . $args['after_title']; } ?> <ul> <?php foreach (array_keys(bbp_get_views()) as $view) { ?> <li><a class="bbp-view-title" href="<?php bbp_view_url($view); ?> "><?php bbp_view_title($view); ?> </a></li> <?php } ?> </ul> <?php echo $args['after_widget']; }