Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: widget_update_callback

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
442                      * to update settings.
443                      *
444                      * @since 2.8.0
445                      *
446                      * @param array     $instance     The current widget instance's settings.
447                      * @param array     $new_instance Array of new widget settings.
448                      * @param array     $old_instance Array of old widget settings.
449                      * @param WP_Widget $this         The current widget instance.
450                      */
451                     $instance = apply_filters( 'widget_update_callback', $instance, $new_instance, $old_instance, $this );
452                     if ( false !== $instance ) {
453                          $all_instances[$number] = $instance;
454                     }
455
456                     break; // run only once
457                }
458           }
459
460           $this->save_settings($all_instances);