default_{$meta_type}_metadata

FILTER wp-includes\meta.php (ligne 747) github
Filters the default metadata value for a specified meta key and object. 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). Possible filter names include:  - `default_blog_metadata`  - `default_post_metadata`  - `default_comment_metadata`  - `default_term_metadata`  - `default_user_metadata`

Paramètres

Entrée :
$value, $object_id, $meta_key, $single, $meta_type
Sortie :
@param mixed  $value     The value to return, either a single metadata value or an array
@param int    $object_id ID of the object metadata is for.
@param string $meta_key  Metadata key.
@param bool   $single    Whether to return only the first value of the specified `$meta_key`.
@param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',

Utilisation

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

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

Actualités

Chargement des actualités...