Skip to content

Instantly share code, notes, and snippets.

@itthinx
Last active November 12, 2024 10:54
Show Gist options
  • Select an option

  • Save itthinx/3907574bede6426d95fa8797a0a4dbbd to your computer and use it in GitHub Desktop.

Select an option

Save itthinx/3907574bede6426d95fa8797a0a4dbbd 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