do_action( 'wp_register_sidebar_widget', array $widget )

Fires once for each registered widget.


Parameters

$widget array
An array of default widget arguments.

Top ↑

Source

File: wp-includes/widgets.php. View all references

do_action( 'wp_register_sidebar_widget', $widget );


Top ↑

Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    Contributed by Steven Lin

    Example migrated from Codex:

    This example does something with the default ‘Pages’ widget.

    <?php
    add_action( 'wp_register_sidebar_widget', 'my_function' );
    
    function my_function( $widget ) {
       if ( 'Pages' === $widget['name'] ) {
          // Do something with the default 'Pages' widget here.
       }
    }
    ?>

You must log in before being able to contribute a note or feedback.