Remove Gateway Choice On A Campaign/Donation Page

// add this snippet to functions.php in your theme add_filter( ‘charitable_active_gateways’, ‘charitable_change_gateways_per_campaign’, 10, 1 ); function charitable_change_gateways_per_campaign( $gateways ) { global $post; // $gateways will be an array similar to this: // [offline] => Charitable_Gateway_Offline // [stripe] => Charitable_Gateway_Stripe_AM if…Continue reading

Change Add Product button URL

add_filter( ‘wcv_dashboard_quick_links’, ‘change_add_product_link’ ); /** * Change the add product link * * @param array $links The links. */ function change_add_product_link( $links ) { if ( isset( $links[‘product’] ) ) { $links[‘product’][‘url’] = ‘https://example.com/add-product/’; $links[‘product’][‘label’] = __( ‘Add Product’, ‘wc-vendors’…Continue reading

Automatically Delete Woocommerce Images After Deleting a Product

// Automatically Delete Woocommerce Images After Deleting a Product add_action( ‘before_delete_post’, ‘delete_product_images’, 10, 1 ); function delete_product_images( $post_id ) { $product = wc_get_product( $post_id ); if ( !$product ) { return; } $featured_image_id = $product->get_image_id(); $image_galleries_id = $product->get_gallery_image_ids(); if( !empty(…Continue reading