This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- WooCommerce Anti-Fraud (OPMC) — complete removal of leftover data. | |
| -- | |
| -- For phpMyAdmin / Adminer / any MySQL client, when WP-CLI is not available. | |
| -- Take a full database backup before running this. It deletes data permanently. | |
| -- | |
| -- IMPORTANT: this file assumes the default table prefix `wp_`. If the site uses | |
| -- a different prefix, replace every `wp_` below with the real one first. | |
| -- | |
| -- Two things this file cannot do — handle them separately, see notes at the end: | |
| -- 1. Scheduled cron events |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Purpose: Override AutomateWoo's "From" name and email on a per-workflow basis. | |
| // Note: Edit the $senders map below. Workflow IDs are visible in the URL when | |
| // editing a workflow in wp-admin (e.g. post=123). | |
| if ( ! class_exists( 'AW_Per_Workflow_Sender' ) ) { | |
| final class AW_Per_Workflow_Sender { | |
| /** | |
| * Map of workflow ID => array( 'name' => string, 'email' => string ). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Remove the customer's billing email from the Reply-To header on admin | |
| * order notification emails (New Order, Cancelled Order, Failed Order) | |
| * so that replies stay within the store team. | |
| * | |
| * Replaces the Reply-To with the store's configured "Email from" address | |
| * from WooCommerce > Settings > Emails > Email sender options. | |
| * | |
| * Requires WooCommerce 3.7+. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'admin_email_check_interval', '__return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Disable Product Filters for WooCommerce on search results pages. | |
| * | |
| * This prevents the performance-heavy filter queries from running on search pages | |
| * while keeping filters active on shop, category, and other catalog pages. | |
| * | |
| * @param int|null $filter_id The filter project ID. | |
| * @return int|null The filter ID, or null to disable on search pages. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Dismiss WooCommerce Shipping Migration Notice | |
| * | |
| * Fixes the persistent "WooCommerce Shipping has successfully been installed | |
| * and activated — enjoy the new WooCommerce Shipping experience." notice | |
| * that won't dismiss due to blocked AJAX requests (403 errors). | |
| * | |
| * Usage: Add via Code Snippets plugin (admin only), then deactivate after use. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add GTIN Field to WooCommerce Quick Edit Panel | |
| * | |
| * Allows viewing and editing GTIN from the Quick Edit dropdown. | |
| */ | |
| /** | |
| * Get the GTIN field label (same as product settings). | |
| * | |
| * @return string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add GTIN Column to WooCommerce Products List Table | |
| * | |
| * Adds a sortable, searchable GTIN column to Products > All Products. | |
| */ | |
| // Add GTIN column to products list (positioned after SKU). | |
| add_filter( 'manage_edit-product_columns', function( $columns ) { | |
| // Find SKU position and insert after it. | |
| $sku_position = array_search( 'sku', array_keys( $columns ), true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Disable Min/Max "Group of" quantity rules for bundled products. | |
| * This allows bundled items to have a quantity of 1 even when the | |
| * standalone product has a "Group of 6" rule. | |
| * | |
| * @author Shameem Reza | |
| */ | |
| // Product Bundles side - disable Group of for bundled item calculations. | |
| add_filter( 'woocommerce_bundled_item_group_of_quantity', '__return_zero', 999 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Hide variations for specific products when using Variations as Single Products plugin | |
| * Add product slugs to the $target_products array below | |
| */ | |
| add_filter( 'posts_clauses', 'vaspfw_hide_specific_variations', 99998, 2 ); | |
| function vaspfw_hide_specific_variations( $clauses, $query ) { | |
| global $wpdb; | |
| // Only apply to variation queries | |
| if ( ! isset( $query->query_vars['vaspfw_single_variation_filter'] ) || |
NewerOlder