woocommerce_rest_{$this->post_type}_object_trashable

FILTER woocommerce\includes\rest-api\Controllers\Version3\class-wc-rest-crud-controller.php (ligne 474) github
Filter whether an object is trashable. Return false to disable trash support for the object.

Paramètres

Entrée :
$supports_trash, $object
Sortie :
@param boolean $supports_trash Whether the object type support trashing.
@param WC_Data $object         The object being considered for trashing support.

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_rest_{$this->post_type}_object_trashable'
add_filter('woocommerce_rest_{$this->post_type}_object_trashable', 'ma_fonction_filtre', 10, 1);

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

Actualités

Chargement des actualités...