delete_{$meta_type}_metadata

FILTER wp-includes\meta.php (ligne 448) github
Short-circuits deleting 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:  - `delete_blog_metadata`  - `delete_post_metadata`  - `delete_comment_metadata`  - `delete_term_metadata`  - `delete_user_metadata`

Paramètres

Entrée :
null, $object_id, $meta_key, $meta_value, $delete_all
Sortie :
@param null|bool $delete     Whether to allow metadata deletion of 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 bool      $delete_all Whether to delete the matching metadata entries

Utilisation

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

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

Actualités

Chargement des actualités...