WordPress.org

Make WordPress Core

Changeset 10801


Ignore:
Timestamp:
03/17/09 02:58:15 (6 years ago)
Author:
ryan
Message:

Move submit check into WP_Widget

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-widgets.php

    r10800 r10801  
    4545     
    4646    function update( $new_instance, $old_instance ) { 
    47         if ( !isset($new_instance['submit']) ) // user clicked cancel? 
    48             return false; 
    49  
    5047        $instance = $old_instance; 
    5148        $instance['title'] = strip_tags($new_instance['title']); 
     
    120117     
    121118    function update( $new_instance, $old_instance ) { 
    122         if( !isset($new_instance['submit']) ) // user clicked cancel? 
    123             return false; 
    124  
    125119        $new_instance = (array) $new_instance; 
    126120        $instance = array( 'images' => 0, 'name' => 0, 'description' => 0, 'rating' => 0); 
     
    213207 
    214208    function update( $new_instance, $old_instance ) { 
    215         if ( !isset($new_instance['submit']) ) // user clicked cancel? 
    216             return false; 
    217  
    218209        $instance = $old_instance; 
    219210        $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') ); 
     
    276267 
    277268    function update( $new_instance, $old_instance ) { 
    278         if ( !isset($new_instance['submit']) ) // user clicked cancel? 
    279             return false; 
    280  
    281269        $instance = $old_instance; 
    282270        $instance['title'] = strip_tags($new_instance['title']); 
     
    319307 
    320308    function update( $new_instance, $old_instance ) { 
    321         if ( !isset($new_instance['submit']) ) // user clicked cancel? 
    322             return false; 
    323  
    324309        $instance = $old_instance; 
    325310        $instance['title'] = strip_tags($new_instance['title']); 
  • trunk/wp-includes/widgets.php

    r10798 r10801  
    214214            } 
    215215 
    216             foreach( (array) $_POST['widget-' . $this->id_base] as $number => $new_instance ) { 
     216            foreach ( (array) $_POST['widget-' . $this->id_base] as $number => $new_instance ) { 
    217217                $new_instance = stripslashes_deep($new_instance); 
    218218                $this->_set($number); 
     219 
     220                if ( !isset($new_instance['submit']) ) 
     221                    continue; 
     222 
    219223                if ( isset($all_instances[$number]) ) 
    220224                    $instance = $this->update($new_instance, $all_instances[$number]); 
Note: See TracChangeset for help on using the changeset viewer.