Ticket #12546: hooks_in_widgets.diff
File hooks_in_widgets.diff, 1.5 KB (added by , 14 years ago) |
---|
-
wp-includes/widgets.php
558 558 $wp_registered_sidebars[$sidebar['id']] = $sidebar; 559 559 560 560 add_theme_support('widgets'); 561 561 562 do_action( 'register_sidebar', $sidebar ); 563 562 564 return $sidebar['id']; 563 565 } 564 566 … … 629 631 ); 630 632 $widget = array_merge($widget, $options); 631 633 632 if ( is_callable($output_callback) && ( !isset($wp_registered_widgets[$id]) || did_action( 'widgets_init' ) ) ) 634 if ( is_callable($output_callback) && ( !isset($wp_registered_widgets[$id]) || did_action( 'widgets_init' ) ) ) { 635 do_action( 'wp_register_sidebar_widget', $widget ); 633 636 $wp_registered_widgets[$id] = $widget; 637 } 634 638 } 635 639 636 640 /** … … 685 689 * @param int|string $id Widget ID. 686 690 */ 687 691 function wp_unregister_sidebar_widget($id) { 692 do_action( 'wp_unregister_sidebar_widget', $id ); 693 688 694 wp_register_sidebar_widget($id, '', ''); 689 695 wp_unregister_widget_control($id); 690 696 } … … 878 884 $params = apply_filters( 'dynamic_sidebar_params', $params ); 879 885 880 886 $callback = $wp_registered_widgets[$id]['callback']; 887 888 do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] ); 881 889 882 890 if ( is_callable($callback) ) { 883 891 call_user_func_array($callback, $params); … … 1193 1201 $args = wp_parse_args($args, $default_args); 1194 1202 $instance = wp_parse_args($instance); 1195 1203 1204 do_action( 'the_widget', $widget, $instance, $args ); 1205 1196 1206 $widget_obj->_set(-1); 1197 1207 $widget_obj->widget($args, $instance); 1198 1208 }