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
/* Example shows how to do it with checkboxes */ | |
$(document).on('facetwp-loaded', function { | |
/* deregister the click handler for the filter(s) you're targeting */ | |
$(document).off( 'click', '.facetwp-type-checkboxes .facetwp-checkbox:not(.disabled)'); | |
/* register our own */ | |
$(document).on('click', '.facetwp-type-checkboxes .facetwp-checkbox:not(.disabled)', my_custom_handle_facet_click ); | |
} ); |
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 | |
function my_namespace_remove_acf_from_admin_menu(){ | |
/* How you determing if it's production or not is up to you, we set a constant */ | |
if ( ! defined( 'WP_ENV' ) || WP_ENV !== 'production ) return; | |
/* You can whitelist some users by id, or with a little more code, their username etc*/ | |
$whitlisted_users = []; |
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
#!/usr/bin/env bash | |
function gdpl (){ | |
set -e | |
local RED=`tput setaf 1` | |
local GREEN=`tput setaf 2` | |
local BLUE=`tput setaf 6` | |
local YELLOW=`tput setaf 3` | |
local PURPLE=`tput setaf 5` |
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
/node_modules | |
/bower_components | |
/assets | |
.git* |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
jQuery(document).ready(function($) { | |
// Inside of this function, $() will work as an alias for jQuery() | |
// and other libraries also using $ will not be accessible under this shortcut | |
// Put your code here e.g. $('#page').find('.comments').each( myFunc()); etc | |
}); |
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
(function($) { | |
// Inside of this function, $() will work as an alias for jQuery() | |
// and other libraries also using $ will not be accessible under this shortcut | |
// Put your code here e.g. $('#page').find('.comments').each( myFunc()); etc | |
})(jQuery); |
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 | |
// Make sure you only use opening / closing tags if needed!!! | |
// Removes Contact Form 7 scripts and Styles except on contact-us page | |
add_action( 'wp', 'BSHP_cf7_conditionally_load_assets_custom' ); | |
// returns false, used for setting filters to false | |
function return_false() { | |
return false; | |
} |
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 | |
// Make sure you only use opening / closing tags if needed!!! | |
// Removes Contact Form 7 scripts and Styles except on contact-us page | |
add_action( 'wp', 'BSHP_cf7_conditionally_load_assets_simple' ); | |
// returns false, used for setting filters to false | |
function return_false() { | |
return false; | |
} |
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 | |
// Make sure you only use opening / closing tags if needed!!! | |
// Late priority so WC can't jump back in and re-enqueue them | |
add_action( 'wp_enqueue_scripts', 'woocommerce_de_script', 100 ); | |
// Removes WooCommerce Scripts on non shop/product/cart/checkout pages | |
function woocommerce_de_script() { | |
if ( function_exists( 'is_woocommerce' ) ) { | |
if ( !is_shop() && !is_cart() && !is_checkout() && !is_account_page() && !is_page_template( 'custom-template.php' ) { |
NewerOlder