AnsPress_Leaderboard_Widget::update( array $new_instance, array $old_instance )
Description #
Sanitize widget form values as they are saved.
Parameters #
- $new_instancearray (Required) Values just sent to be saved.
- $old_instancearray (Required) Previously saved values from database.
Source #
File: widgets/leaderboard.php
public function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? wp_strip_all_tags( $new_instance['title'] ) : ''; $instance['avatar_size'] = ( ! empty( $new_instance['avatar_size'] ) ) ? absint( $new_instance['avatar_size'] ) : 40; $instance['show_users'] = ( ! empty( $new_instance['show_users'] ) ) ? absint( $new_instance['show_users'] ) : 12; $instance['users_per_row'] = ( ! empty( $new_instance['users_per_row'] ) ) ? absint( $new_instance['users_per_row'] ) : 4; $instance['interval'] = ( ! empty( $new_instance['interval'] ) ) ? absint( $new_instance['interval'] ) : 30; return $instance; }
Expand full source code Collapse full source code View on GitHub: widgets/leaderboard.php:183
Add your comment