rest_pre_get_setting

rest_pre_get_setting

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

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('rest_pre_get_setting') is found 1 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php line 98
    			 *                       follow the default get_option() behavior.
    			 * @param string $name   Setting name (as shown in REST API responses).
    			 * @param array  $args   Arguments passed to register_setting() for this setting.
    			 */
    			$response[ $name ] = apply_filters( 'rest_pre_get_setting', null, $name, $args );
    
    			if ( is_null( $response[ $name ] ) ) {
    				// Default to a null value as "null" in the response means "not set".
    				$response[ $name ] = get_option( $args['option_name'], $args['schema']['default'] );
    			}
    
    

See this hook used in plugins: