Action hook 'wp_register_sidebar_widget'

in WP Core File wp-includes/widgets.php at line 432

View Source

wp_register_sidebar_widget

Action Hook
Description
Fires once for each registered widget.

Hook Information

File Location wp-includes/widgets.php View on GitHub
Hook Type Action
Line Number 432

Hook Parameters

Type Name Description
array $widget An array of default widget arguments.

Usage Examples

Basic Usage
<?php
// Hook into wp_register_sidebar_widget
add_action('wp_register_sidebar_widget', 'my_custom_function', 10, 1);

function my_custom_function($widget) {
    // Your custom code here
}

Source Code Context

wp-includes/widgets.php:432 - How this hook is used in WordPress core
<?php
 427  		 *
 428  		 * @since 3.0.0
 429  		 *
 430  		 * @param array $widget An array of default widget arguments.
 431  		 */
 432  		do_action( 'wp_register_sidebar_widget', $widget );
 433  		$wp_registered_widgets[ $id ] = $widget;
 434  	}
 435  }
 436  
 437  /**

PHP Documentation

<?php
/**
		 * Fires once for each registered widget.
		 *
		 * @since 3.0.0
		 *
		 * @param array $widget An array of default widget arguments.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/widgets.php
Related Hooks

Related hooks will be displayed here in future updates.