This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WooCommerce remove a Brand tab from the single product page | |
add_filter('woocommerce_product_tabs', 'eworkshop_remove_about_brand_tab', 99); | |
function eworkshop_remove_about_brand_tab($tabs) { | |
// Replace 'about_brand' with the actual key of the tab you want to remove | |
if (isset($tabs['brand_tab'])) { | |
unset($tabs['brand_tab']); | |
} | |
return $tabs; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** WooCommerce automatically delete expired coupons */ | |
// WP Crone adding new interval schedule | |
add_filter( 'cron_schedules', 'cron_add_custom_interval' ); | |
function cron_add_custom_interval( $schedules ) { | |
// Adds custom time interval to the existing schedules | |
$schedules['custominterval'] = array( | |
'interval' => 86400, // in seconds | |
'display' => __( 'Custom interval' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// To make this plugin to work, you must put this file in "wp-content/mu-plugins" directory. | |
// You can read mora about WordPress MU (Must Use) Plugins on the link -> https://wordpress.org/support/article/must-use-plugins/ | |
add_filter( 'option_active_plugins', 'disable_specific_plugin' ); | |
function disable_specific_plugin($plugins){ | |
if( $_SERVER['REQUEST_URI'] == '/some-url' ) { // Change "/some-url" with url of page you want to disable plugin (without domain). | |
$key = array_search( 'some-plugin/some-plugin.php' , $plugins ); // Change "some-plugin/some-plugin.php" with the directory name and main .php file name of the plugin you want to disable. | |
if ( false !== $key ) unset( $plugins[$key] ); | |
} | |
return $plugins; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This code should be added to your WordPress child theme functions.php | |
// Woocommerce append a text to total price on the "Cart" & "Check out" page | |
add_filter( 'woocommerce_cart_totals_order_total_html', 'eworkshop_custom_total_message_html', 10, 1 ); | |
function eworkshop_custom_total_message_html( $value ) { | |
$value .= __('<br>some custom TXT') . '<br>'; | |
return $value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is add-on for official WooCommerce Brands plugin -> https://woocommerce.com/products/brands/ | |
// To make this add-on to work, all code must be added to WP functionality plugin -> https://css-tricks.com/wordpress-functionality-plugins/ | |
add_action( 'init', 'eworkshop_remove_actions' ); | |
function eworkshop_remove_actions() { | |
// WooCommerce remove brand from single product page | |
remove_action( 'woocommerce_product_meta_end', array( $GLOBALS['WC_Brands'], 'show_brand' ) ); | |
} | |
// WooCommerce display brand image on single product page |