register_setting_args

register_setting_args

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('register_setting_args') is found 1 times:

  • /wp-includes/option.php line 2975
    	 * @param array  $defaults     Array of default arguments.
    	 * @param string $option_group Setting group.
    	 * @param string $option_name  Setting name.
    	 */
    	$args = apply_filters( 'register_setting_args', $args, $defaults, $option_group, $option_name );
    
    	$args = wp_parse_args( $args, $defaults );
    
    	// Require an item schema when registering settings with an array type.
    	if ( false !== $args['show_in_rest'] && 'array' === $args['type'] && ( ! is_array( $args['show_in_rest'] ) || ! isset( $args['show_in_rest']['schema']['items'] ) ) ) {
    		_doing_it_wrong( __FUNCTION__, __( 'When registering an "array" setting to show in the REST API, you must specify the schema for each array item in "show_in_rest.schema.items".' ), '5.4.0' );
    

See this hook used in plugins: