コード例 #1
0
ファイル: widgets.php プロジェクト: sdh100shaun/pantheon
    /**
     * 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'];
    }
コード例 #2
0
ファイル: bbp-core-widgets.php プロジェクト: rmccue/bbPress
    /**
     * 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;
        }
    }
コード例 #3
0
<form role="search" method="get" id="d4p-bbp-searchtopics-form" action="<?php 
bbp_view_url('search');
?>
" >
    <div>
        <label class="screen-reader-text" for="s"><?php 
_e("Search for:", "gd-bbpress-widgets");
?>
</label>
        <input type="text" value="<?php 
echo get_search_query();
?>
" name="s" />
        <input type="submit" value="<?php 
_e("Search", "gd-bbpress-widgets");
?>
" />
    </div>
</form>