woocommerce_rest_{$this->post_type}_trashable

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

Paramètres

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

Utilisation

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

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

Actualités

Chargement des actualités...