Skip to content

Instantly share code, notes, and snippets.

View ivo-ivanov's full-sized avatar
🚀

Ivo Ivanov ivo-ivanov

🚀
View GitHub Profile
/*!
* 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.
*
@renjith-ph
renjith-ph / functions.php
Last active December 10, 2019 14:37
Snippet to hide the woocommerce shipping methods based on user role
/**
* 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
@mattclements
mattclements / function.php
Last active October 29, 2024 22:04
Wordpress Disable Comments (add to function.php)
<?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;
}
@DevinWalker
DevinWalker / woocommerce-optimize-scripts.php
Last active November 14, 2024 09:20
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* 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' ) );