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

Process a widget save.

Description

Parameters

$new_instance

(Required) The parameters saved by the user.

$old_instance

(Required) The parameters as previously saved to the database.

Return

(array) $instance The processed settings to save.

Source

File: bp-friends/classes/class-bp-core-friends-widget.php

228
229
230
231
232
233
234
235
236
function update( $new_instance, $old_instance ) {
    $instance = $old_instance;
 
    $instance['max_friends']    = absint( $new_instance['max_friends'] );
    $instance['friend_default'] = sanitize_text_field( $new_instance['friend_default'] );
    $instance['link_title']     = (bool) $new_instance['link_title'];
 
    return $instance;
}

Changelog

Changelog
Version Description
BuddyPress 1.9.0 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.