Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
POC disable the marketing hub menu item
<?php
/**
* Plugin Name: Disable the WooCommerce Marketing Hub
*/
/**
* Option - Remove marketing features - basic example to demonstrate usage
*/
add_filter(
'woocommerce_admin_get_feature_config',
function ( $features ) {
$features['coupons'] = false;
$features['marketing'] = false;
return $features;
}
);
/**
* Option - Remove marketing features - basic example to demonstrate usage
*/
add_filter( 'woocommerce_admin_features', 'disable_features' );
function disable_features( $features ) {
$marketing = array_search('marketing', $features);
unset( $features[$marketing] );
//$coupons = array_search('coupons', $features);
//unset( $features[$coupons] );
//array_values( $features );
return $features;
}
/**
* Add/edit additional marketing hub menu item/s
*/
//add_filter( 'woocommerce_marketing_menu_items', '__return_empty_array' );
/**
* Remove wc-admin
*/
//add_filter( 'woocommerce_admin_disabled', '__return_true' );
@erikdemarco

This comment has been minimized.

Copy link

@erikdemarco erikdemarco commented Sep 15, 2020

what is the difference between 'woocommerce_admin_get_feature_config' and 'woocommerce_admin_features' should i use both? or just one of them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.