Categories::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: addons/categories/widget.php
public function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? wp_strip_all_tags( $new_instance['title'] ) : ''; $instance['hide_empty'] = ( ! empty( $new_instance['hide_empty'] ) ) ? wp_strip_all_tags( $new_instance['hide_empty'] ) : false; $instance['parent'] = ( ! empty( $new_instance['parent'] ) ) ? wp_strip_all_tags( $new_instance['parent'] ) : '0'; $instance['number'] = ( ! empty( $new_instance['number'] ) ) ? wp_strip_all_tags( $new_instance['number'] ) : '5'; $instance['orderby'] = ( ! empty( $new_instance['orderby'] ) ) ? wp_strip_all_tags( $new_instance['orderby'] ) : 'count'; $instance['order'] = ( ! empty( $new_instance['order'] ) ) ? wp_strip_all_tags( $new_instance['order'] ) : 'DESC'; $instance['icon_width'] = ( ! empty( $new_instance['icon_width'] ) ) ? (int) $new_instance['icon_width'] : 32; $instance['icon_height'] = ( ! empty( $new_instance['icon_height'] ) ) ? (int) $new_instance['icon_height'] : 32; return $instance; }
Expand full source code Collapse full source code View on GitHub: addons/categories/widget.php:213
Add your comment