do_action( ‘wp_register_sidebar_widget’, array $widget )

Fires once for each registered widget.

Parameters

$widgetarray
An array of default widget arguments.

Source

do_action( 'wp_register_sidebar_widget', $widget );

Changelog

VersionDescription
3.0.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    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.