Make WordPress Core

Changeset 14382


Ignore:
Timestamp:
05/03/2010 07:01:43 PM (14 years ago)
Author:
ryan
Message:

Hooks for the widgets api. Props ptahdunbar. fixes #12546

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/widgets.php

    r14320 r14382  
    559559
    560560    add_theme_support('widgets');
    561 
     561   
     562    do_action( 'register_sidebar', $sidebar );
     563   
    562564    return $sidebar['id'];
    563565}
     
    630632    $widget = array_merge($widget, $options);
    631633
    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 );
    633636        $wp_registered_widgets[$id] = $widget;
     637    }
    634638}
    635639
     
    686690 */
    687691function wp_unregister_sidebar_widget($id) {
     692    do_action( 'wp_unregister_sidebar_widget', $id );
     693   
    688694    wp_register_sidebar_widget($id, '', '');
    689695    wp_unregister_widget_control($id);
     
    879885
    880886        $callback = $wp_registered_widgets[$id]['callback'];
     887       
     888        do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] );
    881889
    882890        if ( is_callable($callback) ) {
     
    11941202    $instance = wp_parse_args($instance);
    11951203
     1204    do_action( 'the_widget', $widget, $instance, $args );
     1205
    11961206    $widget_obj->_set(-1);
    11971207    $widget_obj->widget($args, $instance);
Note: See TracChangeset for help on using the changeset viewer.