WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
86 | * |
87 | * @since 4.7.0 |
88 | * |
89 | * @param mixed $result Value to use for the requested setting. Can be a scalar |
90 | * matching the registered schema for the setting, or null to |
91 | * follow the default get_option() behavior. |
92 | * @param string $name Setting name (as shown in REST API responses). |
93 | * @param array $args Arguments passed to register_setting() for this setting. |
94 | */ |
95 | $response[ $name ] = apply_filters( 'rest_pre_get_setting', null, $name, $args ); |
96 |
|
97 | if ( is_null( $response[ $name ] ) ) { |
98 | // Default to a null value as "null" in the response means "not set". |
99 | $response[ $name ] = get_option( $args['option_name'], $args['schema']['default'] ); |
100 | } |
101 |
|
102 | /* |
103 | * Because get_option() is lossy, we have to |
104 | * cast values to the type they are registered with. |