Action hook 'register_sidebar'

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

View Source

register_sidebar

Action Hook
Description
Fires once a sidebar has been registered.

Hook Information

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

Hook Parameters

Type Name Description
array $sidebar Parsed arguments for the registered sidebar.

Usage Examples

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

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

Source Code Context

wp-includes/widgets.php:327 - How this hook is used in WordPress core
<?php
 322  	 *
 323  	 * @since 3.0.0
 324  	 *
 325  	 * @param array $sidebar Parsed arguments for the registered sidebar.
 326  	 */
 327  	do_action( 'register_sidebar', $sidebar );
 328  
 329  	return $sidebar['id'];
 330  }
 331  
 332  /**

PHP Documentation

<?php
/**
	 * Fires once a sidebar has been registered.
	 *
	 * @since 3.0.0
	 *
	 * @param array $sidebar Parsed arguments for the registered sidebar.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/widgets.php
Related Hooks

Related hooks will be displayed here in future updates.