Skip to content

Instantly share code, notes, and snippets.

@joost-abrahams
Forked from itthinx/wc-enable-brands.php
Created November 12, 2024 10:54
Show Gist options
  • Select an option

  • Save joost-abrahams/8da02b960707114be49c0ac5dcbb9d4e to your computer and use it in GitHub Desktop.

Select an option

Save joost-abrahams/8da02b960707114be49c0ac5dcbb9d4e to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: WC Enable Brands
* Description: Enable the Brands feature available as of WooCommerce 9.4.
*/
if ( !defined( 'ABSPATH' ) ) {
exit;
}
/**
* Plugin class.
*
* @see https://developer.woocommerce.com/2024/10/01/introducing-brands/
*/
class WC_Enable_Brands {
/**
* Enable the Brands feature.
*/
public static function init() {
update_option( 'wc_feature_woocommerce_brands_enabled', 'yes' );
update_option( 'woocommerce_remote_variant_assignment', 2 );
}
}
add_action( 'init', array( 'WC_Enable_Brands', 'init' ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment