Browse Source

Permite desabilitar funcionalidades desnecessárias do WooCommerce

master
Guilherme Capanema 5 years ago
parent
commit
2f3a541f42
2 changed files with 21 additions and 0 deletions
  1. +1
    -0
      plate.php
  2. +20
    -0
      src/disable-woocommerce-bloat.php

+ 1
- 0
plate.php View File

@ -24,6 +24,7 @@ add_action('after_setup_theme', function () {
require_if_theme_supports('plate-disable-dashboard', __DIR__ . '/src/disable-dashboard.php'); require_if_theme_supports('plate-disable-dashboard', __DIR__ . '/src/disable-dashboard.php');
require_if_theme_supports('plate-disable-menu', __DIR__ . '/src/disable-menu.php'); require_if_theme_supports('plate-disable-menu', __DIR__ . '/src/disable-menu.php');
require_if_theme_supports('plate-disable-toolbar', __DIR__ . '/src/disable-toolbar.php'); require_if_theme_supports('plate-disable-toolbar', __DIR__ . '/src/disable-toolbar.php');
require_if_theme_supports('plate-disable-woocommerce-bloat', __DIR__ . '/src/disable-woocommerce-bloat.php');
require_if_theme_supports('plate-footer-text', __DIR__ . '/src/footer-text.php'); require_if_theme_supports('plate-footer-text', __DIR__ . '/src/footer-text.php');
require_if_theme_supports('plate-login-logo', __DIR__ . '/src/login-logo.php'); require_if_theme_supports('plate-login-logo', __DIR__ . '/src/login-logo.php');
require_if_theme_supports('plate-permalink', __DIR__ . '/src/permalink.php'); require_if_theme_supports('plate-permalink', __DIR__ . '/src/permalink.php');


+ 20
- 0
src/disable-woocommerce-bloat.php View File

@ -0,0 +1,20 @@
<?php
/**
* Copyright (c) Guilherme Capanema.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://git.horizontes.info/capanema/plate
*/
declare(strict_types=1);
// Remove marketing menu
add_filter('woocommerce_admin_features', function ($features) {
$marketing = array_search('marketing', $features);
unset($features[$marketing]);
return $features;
});

Loading…
Cancel
Save