Ticket #29790: 29790.patch
File 29790.patch, 1.5 KB (added by , 10 years ago) |
---|
-
src/wp-includes/widgets.php
182 182 * Just finds the instance and calls widget(). 183 183 * Do NOT over-ride this function. */ 184 184 public function display_callback( $args, $widget_args = 1 ) { 185 if ( is_numeric( $widget_args) )185 if ( is_numeric( $widget_args ) ) { 186 186 $widget_args = array( 'number' => $widget_args ); 187 } 187 188 188 189 $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); 189 190 $this->_set( $widget_args['number'] ); 190 191 $instance = $this->get_settings(); 191 192 192 193 if ( array_key_exists( $this->number, $instance ) ) { 193 194 $instance = $instance[$this->number]; 194 195 … … 203 204 * @param WP_Widget $this The current widget instance. 204 205 * @param array $args An array of default widget arguments. 205 206 */ 207 208 $instance['widget_area'] = $args; 206 209 $instance = apply_filters( 'widget_display_callback', $instance, $this, $args ); 207 210 208 211 if ( false === $instance ) { … … 335 338 * @param array $instance The current widget instance's settings. 336 339 * @param WP_Widget $this The current widget instance. 337 340 */ 341 342 $sidebar_id = is_active_widget( true, $this->id ); 343 if ( $sidebar_id !== false ) { 344 $instance[ 'widget_area'][ 'id' ] = $sidebar_id; 345 } 338 346 $instance = apply_filters( 'widget_form_callback', $instance, $this ); 339 347 340 348 $return = null;