BBP_Replies_Widget::update( array $new_instance = array(), array $old_instance = array() )

Update the reply widget options

Description

Parameters

$new_instance

(array) (Optional) The new instance options

Default value: array()

$old_instance

(array) (Optional) The old instance options

Default value: array()

Source

File: bp-forums/common/widgets.php

	public function update( $new_instance = array(), $old_instance = array() ) {
		$instance              = $old_instance;
		$instance['title']     = strip_tags( $new_instance['title'] );
		$instance['max_shown'] = (int) $new_instance['max_shown'];

		// Date
		$instance['show_date'] = isset( $new_instance['show_date'] )
			? (bool) $new_instance['show_date']
			: false;

		// Author
		$instance['show_user'] = isset( $new_instance['show_user'] )
			? (bool) $new_instance['show_user']
			: false;

		return $instance;
	}

Changelog

Changelog
Version Description
bbPress (r2653) 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.