BP_Groups_Widget::update( array $new_instance, array $old_instance )

Extends our update method.


Parameters Parameters

$new_instance

(array) (Required) New instance data.

$old_instance

(array) (Required) Original instance data.


Top ↑

Return Return

(array)


Source Source

File: bp-groups/classes/class-bp-groups-widget.php

	public function update( $new_instance, $old_instance ) {
		$instance = $old_instance;

		$max_limit = bp_get_widget_max_count_limit( __CLASS__ );

		$instance['title']         = strip_tags( $new_instance['title'] );
		$instance['max_groups']    = $new_instance['max_groups'] > $max_limit ? $max_limit : intval( $new_instance['max_groups'] );
		$instance['group_default'] = strip_tags( $new_instance['group_default'] );
		$instance['link_title']    = ! empty( $new_instance['link_title'] );

		return $instance;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.