do_action( 'wp_register_sidebar_widget', array $widget )

Fires once for each registered widget.


Parameters Parameters

$widget

(array) An array of default widget arguments.


Top ↑

Source Source

File: wp-includes/widgets.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by stevenlinx

    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.