register_setting
Action HookDescription
Fires immediately before the setting is registered but after its filters are in place.Hook Information
| File Location |
wp-includes/option.php
View on GitHub
|
| Hook Type | Action |
| Line Number | 3069 |
Hook Parameters
| Type | Name | Description |
|---|---|---|
string
|
$option_group
|
Setting group. |
string
|
$option_name
|
Setting name. |
array
|
$args
|
Array of setting registration arguments. |
Usage Examples
Basic Usage
<?php
// Hook into register_setting
add_action('register_setting', 'my_custom_function', 10, 3);
function my_custom_function($option_group, $option_name, $args) {
// Your custom code here
}
Source Code Context
wp-includes/option.php:3069
- How this hook is used in WordPress core
<?php
3064 *
3065 * @param string $option_group Setting group.
3066 * @param string $option_name Setting name.
3067 * @param array $args Array of setting registration arguments.
3068 */
3069 do_action( 'register_setting', $option_group, $option_name, $args );
3070
3071 $wp_registered_settings[ $option_name ] = $args;
3072 }
3073
3074 /**
PHP Documentation
<?php
/**
* Fires immediately before the setting is registered but after its filters are in place.
*
* @since 5.5.0
*
* @param string $option_group Setting group.
* @param string $option_name Setting name.
* @param array $args Array of setting registration arguments.
*/
Quick Info
- Hook Type: Action
- Parameters: 3
- File: wp-includes/option.php
Related Hooks
Related hooks will be displayed here in future updates.