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
VersionDescription
0.1Introduced.

More Information

You are currently logged out. To view tickets you must first login.

I have read and understood the Terms of Service


User Contributed Notes

Leave a Reply

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