mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Move submit check into WP_Widget
git-svn-id: http://svn.automattic.com/wordpress/trunk@10801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
98ecb6c9f5
commit
226ef505b3
@ -44,9 +44,6 @@ class WP_Widget_Pages extends WP_Widget {
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
if ( !isset($new_instance['submit']) ) // user clicked cancel?
|
||||
return false;
|
||||
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
if ( in_array( $new_instance['sortby'], array( 'post_title', 'menu_order', 'ID' ) ) ) {
|
||||
@ -119,9 +116,6 @@ class WP_Widget_Links extends WP_Widget {
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
if( !isset($new_instance['submit']) ) // user clicked cancel?
|
||||
return false;
|
||||
|
||||
$new_instance = (array) $new_instance;
|
||||
$instance = array( 'images' => 0, 'name' => 0, 'description' => 0, 'rating' => 0);
|
||||
foreach ( $instance as $field => $val ) {
|
||||
@ -212,9 +206,6 @@ class WP_Widget_Archives extends WP_Widget {
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
if ( !isset($new_instance['submit']) ) // user clicked cancel?
|
||||
return false;
|
||||
|
||||
$instance = $old_instance;
|
||||
$new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') );
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
@ -275,9 +266,6 @@ class WP_Widget_Meta extends WP_Widget {
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
if ( !isset($new_instance['submit']) ) // user clicked cancel?
|
||||
return false;
|
||||
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
|
||||
@ -318,9 +306,6 @@ class WP_Widget_Calendar extends WP_Widget {
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
if ( !isset($new_instance['submit']) ) // user clicked cancel?
|
||||
return false;
|
||||
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
|
||||
|
@ -213,9 +213,13 @@ class WP_Widget {
|
||||
}
|
||||
}
|
||||
|
||||
foreach( (array) $_POST['widget-' . $this->id_base] as $number => $new_instance ) {
|
||||
foreach ( (array) $_POST['widget-' . $this->id_base] as $number => $new_instance ) {
|
||||
$new_instance = stripslashes_deep($new_instance);
|
||||
$this->_set($number);
|
||||
|
||||
if ( !isset($new_instance['submit']) )
|
||||
continue;
|
||||
|
||||
if ( isset($all_instances[$number]) )
|
||||
$instance = $this->update($new_instance, $all_instances[$number]);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user