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
/*! | |
* VERSION: 0.9.1 | |
* DATE: 2019-02-21 | |
* UPDATES AND DOCS AT: http://greensock.com | |
* | |
* @license Copyright (c) 2008-2019, GreenSock. All rights reserved. | |
* MorphSVGPlugin is a Club GreenSock membership benefit; You must have a valid membership to use | |
* this code without violating the terms of use. Visit http://greensock.com/club/ to sign up or get more details. | |
* This work is subject to the software agreement that was issued with your membership. | |
* |
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
/** | |
* Title : Snippet to hide the woocommerce shipping methods based on user role . | |
* Created at : 08 March 2019 | |
* Updated at : 08 March 2019 | |
* Pluginhive Plugins : https://www.pluginhive.com/ | |
* Gist Link : https://gist.github.com/renjith-ph/e72e111a31ffb8b2e52742dd5c374d37/ | |
*/ | |
add_filter( 'woocommerce_package_rates', function( $shipping_rates ) { | |
// Provide user role and shipping methods values pair |
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 | |
add_action('admin_init', function () { | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_redirect(admin_url()); | |
exit; | |
} |
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
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |