register_setting_args

Filters the registration arguments when registering a setting.

Description

apply_filters( 'register_setting_args', (array) $args, (array) $defaults, (string) $option_group, (string) $option_name ); 

Parameters (4)

0. $args (array)
Array of setting registration arguments.
1. $defaults (array)
Array of default arguments.
2. $option_group (string)
The option group.
3. $option_name (string)
The option name.

Usage

To run the hook, copy the example below.
  1. $args = apply_filters( 'register_setting_args', $args, $defaults, $option_group, $option_name ); 
  2.  
  3. if ( !empty( $args ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the register_setting_args callback 
  2. function filter_register_setting_args( $args, $defaults, $option_group, $option_name ) { 
  3. // make filter magic happen here... 
  4. return $args
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'register_setting_args', 'filter_register_setting_args', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'register_setting_args', 'filter_register_setting_args', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/option.php  
  1. $args = apply_filters( 'register_setting_args', $args, $defaults, $option_group, $option_name );