A_Z_Widget::update( Array $new_instance, Array $old_instance )

Called by WordPress core. Sanitises changes to the Widget’s configuration.


Description


Parameters

$new_instance

(Array) (Required) the new configuration values.

$old_instance

(Array) (Required) the previous configuration values.


Return

(Array) sanitised version of the new configuration values to be saved


Source

File: widgets/class-a-z-widget.php

	function update( $new_instance, $old_instance ) {
		$instance = $old_instance;
		$instance['title'] = strip_tags( $new_instance['title'] );
		$instance['post'] = (int) $new_instance['post'];
		$instance['post_type'] = strip_tags( $new_instance['post_type'] );
		$instance['parent'] = (int) $new_instance['parent'];
		return $instance;
	}

Changelog

Changelog
Version Description
0.1 Introduced.

User Contributed Notes

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.