Skip to content

Instantly share code, notes, and snippets.

@helgatheviking
Created December 17, 2019 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helgatheviking/e3424f7d64daefd4b48809bdcdba73b2 to your computer and use it in GitHub Desktop.
Save helgatheviking/e3424f7d64daefd4b48809bdcdba73b2 to your computer and use it in GitHub Desktop.
Disable Cost of Goods Compat Module in Mix and Match
<?php
/**
* Plugin Name: Disable Cost of Goods Compat Module in Mix and Match
* Plugin URI: https://woocommerce.com/
* Description: Disable Cost of Goods Compat Module in Mix and Match
* Version: 1.0.0
* Author: Kathy Darling
* Author URI: http://kathyisawesome.com/
* Requires at least: 5.3.0
* Tested up to: 5.3.0
*
* WC requires at least: 3.8.0
* WC tested up to: 3.8.0
*
* Copyright: © 2019 Kathy Darling
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Disable the Cost of Good compat module.
*
* @param array $modules
* @return array
*/
function kia_disable_mnm_modules( $modules ) {
unset( $modules['cog'] );
return $modules;
}
add_filter( 'wc_mnm_compatibility_modules', 'kia_disable_mnm_modules' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment