BP_Core_Network_Posts_Widget::update( array $new_instance, array $old_instance )
Update the Members widget options.
Description
Parameters
- $new_instance
-
(Required) The new instance options.
- $old_instance
-
(Required) The old instance options.
Return
(array) $instance The parsed options to be saved.
Source
File: bp-core/classes/class-bp-core-network-posts-widget.php
public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance[ 'number' ] = (int) $new_instance[ 'number' ]; $instance[ 'show_date' ] = isset( $new_instance[ 'show_date' ] ) ? (bool) $new_instance[ 'show_date' ] : false; $instance[ 'show_image' ] = isset( $new_instance[ 'show_image' ] ) ? (bool) $new_instance[ 'show_image' ] : false; return $instance; }
Changelog
Version | Description |
---|---|
1.0.3 | 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.