BBP_Search_Widget::widget( $args,  $instance )

Displays the output, the search form

Description

Source

File: bp-forums/common/widgets.php

	public function widget( $args, $instance ) {

		// Bail if search is disabled
		if ( ! bbp_allow_search() )
			return;

		// Get widget settings
		$settings = $this->parse_settings( $instance );

		// Typical WordPress filter
		$settings['title'] = apply_filters( 'widget_title',            $settings['title'], $instance, $this->id_base );

		// Forums filter
		$settings['title'] = apply_filters( 'bbp_search_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'];
		}

		bbp_get_template_part( 'form', 'search' );

		echo $args['after_widget'];
	}

Changelog

Changelog
Version Description
bbPress (r4579) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.