Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: widget_display_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
171                $widget_args = array( 'number' => $widget_args );
172
173           $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );
174           $this->_set( $widget_args['number'] );
175           $instance = $this->get_settings();
176
177           if ( array_key_exists( $this->number, $instance ) ) {
178                $instance = $instance[$this->number];
179                // filters the widget's settings, return false to stop displaying the widget
180                $instance = apply_filters('widget_display_callback', $instance, $this, $args);
181                if ( false !== $instance )
182                     $this->widget($args, $instance);
183           }
184      }
185
186      /** Deal with changed settings.
187       *     Do NOT over-ride this function. */
188      function update_callback( $widget_args = 1 ) {
189           global $wp_registered_widgets;