update_comment_metadata_by_mid
Short-circuits updating metadata of a specific type by meta ID.
This is one of the variants of the dynamic hook update_(meta_type)_metadata_by_mid
Usage
add_filter( 'update_comment_metadata_by_mid', 'wp_kama_update_comment_metadata_by_mid_filter', 10, 4 ); /** * Function for `update_comment_metadata_by_mid` filter-hook. * * @param null|bool $check Whether to allow updating metadata for the given type. * @param int $meta_id Meta ID. * @param mixed $meta_value Meta value. Must be serializable if non-scalar. * @param string|false $meta_key Meta key, if provided. * * @return null|bool */ function wp_kama_update_comment_metadata_by_mid_filter( $check, $meta_id, $meta_value, $meta_key ){ // filter... return $check; }
- $check(null|true|false)
- Whether to allow updating metadata for the given type.
- $meta_id(int)
- Meta ID.
- $meta_value(mixed)
- Meta value. Must be serializable if non-scalar.
- $meta_key(string|false)
- Meta key, if provided.
Changelog
Since 5.0.0 | Introduced. |
Where the hook is called
update_comment_metadata_by_mid
wp-includes/meta.php 903
$check = apply_filters( "update_{$meta_type}_metadata_by_mid", null, $meta_id, $meta_value, $meta_key );