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