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
Search for : (.*(\n|$)){2} | |
alt+R - to toggle regular expression search | |
alt+ENTER - to select all results |
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 goes into theme functions.php or a custom plugin | |
*/ | |
/** | |
* Add product to cart on page load | |
*/ | |
function add_product_to_cart() { |
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
/** | |
* Remove related products | |
*/ | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); |
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 dt_change_default_sidebar() { | |
global $DT_META_BOXES; | |
if ( $DT_META_BOXES ) { | |
if ( isset($DT_META_BOXES[ 'dt_page_box-sidebar' ]) ) { | |
$DT_META_BOXES[ 'dt_page_box-sidebar' ]['fields'][0]['std'] = 'left'; // use disabled to disable sidebar | |
} | |
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_filter( 'woocommerce_email_styles', 'patricks_woocommerce_email_styles' ); | |
function patricks_woocommerce_email_styles( $css ) { | |
$css .= "#template_header { background-color: #231f20; }"; | |
return $css; | |
} |
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 | |
$user_id = get_current_user_id(); | |
if ( wc_memberships_is_user_active_member( $user_id, 'gold' ) ) { | |
get_template_part( 'template', 'gold' ); | |
} else { | |
echo "You are not allowed to view this content"; | |
} | |
?> |
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 | |
/* | |
* Send visitors who submit events to a different page after submission. | |
* | |
* This actually does the redirect. If an event was submitted, and we're about | |
* to reload the submission page (with a message instead of a form), this will | |
* redirect the user. | |
* | |
* @param WP $wp | |
* @return void |