update_{$meta_type}_metadata

FILTER wp-includes\meta.php (ligne 250) github
Short-circuits updating metadata of a specific type. The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (blog, post, comment, term, user, or any other type with an associated meta table). Returning a non-null value will effectively short-circuit the function. Possible hook names include:  - `update_blog_metadata`  - `update_post_metadata`  - `update_comment_metadata`  - `update_term_metadata`  - `update_user_metadata`

Paramètres

Entrée :
null, $object_id, $meta_key, $meta_value, $prev_value
Sortie :
@param null|bool $check      Whether to allow updating metadata for the given type.
@param int       $object_id  ID of the object metadata is for.
@param string    $meta_key   Metadata key.
@param mixed     $meta_value Metadata value. Must be serializable if non-scalar.
@param mixed     $prev_value Optional. Previous value to check before updating.

Utilisation

// Modifier la valeur avec le filtre 'update_{$meta_type}_metadata'
add_filter('update_{$meta_type}_metadata', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre(null) {
    // Modifier la valeur
    return null;
}

Actualités

Chargement des actualités...