Skip to content

Instantly share code, notes, and snippets.

View shivapoudel's full-sized avatar
🎯
Focusing

Shiva Poudel shivapoudel

🎯
Focusing
View GitHub Profile
@shivapoudel
shivapoudel / woocommerce-hidden-products-from-cart.php
Last active January 13, 2023 04:12
Exclude hidden products from cart area.
<?php
/**
* Filter hidden product from cart.
*
* @since 1.0.0
*
* @param bool $visibility Visibility.
* @param array $cart_item Cart item.
* @param string $cart_item_key Cart item key.
*/
@shivapoudel
shivapoudel / functions.php
Last active August 27, 2023 14:01
WooCommerce - Automatically delete attached images after product deletion
<?php
/**
* Delete attached images after product deletion.
*
* @since 1.0.0
*
* @see wp_delete_post()
*
* @param int $post_id Post ID.
*/