wphooks.info - rest_pre_update_setting

rest_pre_update_setting

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php:
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
			 * returning true.
			 *
			 * @since 4.7.0
			 *
			 * @param bool   $result Whether to override the default behavior for updating the
			 *                       value of a setting.
			 * @param string $name   Setting name (as shown in REST API responses).
			 * @param mixed  $value  Updated setting value.
			 * @param array  $args   Arguments passed to register_setting() for this setting.
			 */
			$updated = apply_filters( 'rest_pre_update_setting', false, $name, $request[ $name ], $args );

			if ( $updated ) {
				continue;
			}

			/*
			 * A null value for an option would have the same effect as
			 * deleting the option from the database, and relying on the
			 * default value.