public function update_value( $request, $object_id ) {
		$fields = $this->get_registered_fields();

		foreach ( $fields as $name => $args ) {
			if ( ! array_key_exists( $name, $request ) ) {
				continue;
			}

			// A null value means reset the field, which is essentially deleting it
			// from the database and then relying on the default value.
			if ( is_null( $request[ $name ] ) ) {
				$result = $this->delete_meta_value( $object_id, $name );
			} elseif ( $args['single'] ) {
				$result = $this->update_meta_value( $object_id, $name, $request[ $name ] );
			} else {
				$result = $this->update_multi_meta_value( $object_id, $name, $request[ $name ] );
			}

			if ( is_wp_error( $result ) ) {
				return $result;
			}
		}

		return null;
	}
public function update_value( $request, $object_id ) {
		$fields = $this->get_registered_fields();

		foreach ( $fields as $name => $args ) {
			if ( ! array_key_exists( $name, $request ) ) {
				continue;
			}

			// A null value means reset the field, which is essentially deleting it
			// from the database and then relying on the default value.
			if ( is_null( $request[ $name ] ) ) {
				$result = $this->delete_meta_value( $object_id, $name );
			} elseif ( $args['single'] ) {
				$result = $this->update_meta_value( $object_id, $name, $request[ $name ] );
			} else {
				$result = $this->update_multi_meta_value( $object_id, $name, $request[ $name ] );
			}

			if ( is_wp_error( $result ) ) {
				return $result;
			}
		}

		return null;
	}
public function update_value ( $ request , $ object_id ) { $ fields = $ this -> get_registered_fields ( ) ; foreach ( $ fields as $ name => $ args ) { if ( ! array_key_exists ( $ name , $ request ) ) { continue ; } // A null value means reset the field, which is essentially deleting it // from the database and then relying on the default value. if ( is_null ( $ request [ $ name ] ) ) { $ result = $ this -> delete_meta_value ( $ object_id , $ name ) ; } elseif ( $ args [ 'single' ] ) { $ result = $ this -> update_meta_value ( $ object_id , $ name , $ request [ $ name ] ) ; } else { $ result = $ this -> update_multi_meta_value ( $ object_id , $ name , $ request [ $ name ] ) ; } if ( is_wp_error ( $ result ) ) { return $ result ; } } return null ; }
Update meta values.

@param WP_REST_Request $request    Full details about the request.
@param int             $object_id  Object ID to fetch meta for.
@return WP_Error|null Error if one occurs, null on success.
Update meta values .