Advertisement
YordanSoares

WooCommerce: Disable WooCommerce admin features

Feb 4th, 2024
1,114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.23 KB | Software | 0 0
  1. <?php
  2. /**
  3.  * WooCommerce:
  4.  * Disable WooCommerce admin features
  5.  */
  6. add_filter( 'woocommerce_admin_features', function( $features ) {
  7.     // Uncomment the features you want to be disabled
  8.     $features_to_be_disabled = array(
  9.         // 'activity-panels',
  10.         // 'analytics',
  11.         // 'product-block-editor',
  12.         // 'coupons',
  13.         // 'core-profiler',
  14.         // 'customer-effort-score-tracks',
  15.         // 'import-products-task',
  16.         // 'experimental-fashion-sample-products',
  17.         // 'shipping-smart-defaults',
  18.         // 'shipping-setting-tour',
  19.         // 'homescreen',
  20.         // 'marketing',
  21.         // 'mobile-app-banner',
  22.         // 'navigation',
  23.         // 'onboarding',
  24.         // 'onboarding-tasks',
  25.         // 'product-variation-management',
  26.         // 'product-virtual-downloadable',
  27.         // 'product-external-affiliate',
  28.         // 'product-grouped',
  29.         // 'remote-inbox-notifications',
  30.         // 'remote-free-extensions',
  31.         // 'payment-gateway-suggestions',
  32.         // 'shipping-label-banner',
  33.         // 'subscriptions',
  34.         // 'store-alerts',
  35.         // 'transient-notices',
  36.         // 'woo-mobile-welcome',
  37.         // 'wc-pay-promotion',
  38.         // 'wc-pay-welcome-page',
  39.     );
  40.      foreach( $features as $key => $feature ) {
  41.         if ( in_array( $feature, $features_to_be_disabled ) ) {
  42.             unset( $features[$key] );
  43.         }
  44.      }
  45.     return $features;
  46. } );
Tags: woocommerce
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement