This file contains hidden or 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
add_filter( 'wc_session_expiring', create_function( '', 'return 10;' ) ); | |
add_filter( 'wc_session_expiration', create_function( '', 'return 15;' ) ); |
This file contains hidden or 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
add_filter( 'wc_photography_shop_loop_image_html', 'wc_photography_loop_image_link' ); | |
function wc_photography_loop_image_link( $html ) { | |
global $product; | |
return preg_replace( '/href="([^"]*)"/', sprintf( 'href="%s"', get_permalink( $product->id ) ), $html ); | |
} |
This file contains hidden or 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
add_filter( 'woocommerce_reports_get_order_report_query', 'wc_custom_limit_query' ); | |
function wc_custom_limit_query( $query ) { | |
global $wpdb; | |
$wpdb->query( "SET OPTION SQL_BIG_SELECTS=1" ); | |
return $query; | |
} |
This file contains hidden or 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
// Check the name of your addon field in the source. Example: addon-7934-test-addon | |
jQuery( 'input[name="addon-90-adventure-dates[check-in]"]' ).datepicker( { | |
minDate: 0, | |
"dateFormat": 'yy-mm-dd' | |
} ); |
This file contains hidden or 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
// Check the name of your addon field in the source. Example: addon-7934-test-addon | |
jQuery( "input[name='addon-90-adventure-dates']" ).datepicker( { | |
minDate: 0, | |
"dateFormat": 'yy-mm-dd' | |
} ); |
This file contains hidden or 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
// Check the name of your addon field in the source. Example: addon-7934-test-addon | |
jQuery( 'input[name="addon-90-adventure-dates[check-in]"]' ).datepicker( { | |
minDate: 0, | |
"dateFormat": 'yy-mm-dd' | |
} ); |
This file contains hidden or 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 jeherve_delete_jetpack_menu() { | |
if ( ! current_user_can( 'manage_options' ) ) { | |
remove_menu_page( 'jetpack' ); | |
} | |
} | |
add_action ( 'admin_menu', 'jeherve_delete_jetpack_menu', 999 ); |
This file contains hidden or 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
add_filter( 'woocommerce_countries_base_postcode', create_function( '', 'return "80903";' ) ); | |
add_filter( 'woocommerce_countries_base_city', create_function( '', 'return "COLORADO SPRINGS";' ) ); |
This file contains hidden or 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
add_action( 'subscription_expired', 'wc_custom_remove_subscription', 5, 2 ); | |
function wc_custom_remove_subscription( $user_id, $subscription_key ) { | |
$subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key ); | |
$valid_ids = array( 100, 101, 102 ); | |
if ( isset( $subscription['product_id'] ) && isset( $subscription['order_id'] ) ) { | |
$product_id = $subscription['product_id']; | |
if ( in_array( $product_id, $valid_ids ) ) { | |
remove_action( 'subscription_expired', array( 'Groups_WS_Handler', 'subscription_expired' ), 10, 2 ); | |
} |
This file contains hidden or 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
add_action( 'subscription_expired', 'wc_custom_remove_subscription', 5, 2 ); | |
function wc_custom_remove_subscription( $user_id, $subscription_key ) { | |
$subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key ); | |
if ( isset( $subscription['product_id'] ) && isset( $subscription['order_id'] ) ) { | |
$product_id = $subscription['product_id']; | |
if ( $product_id == 100 ) { | |
remove_action( 'subscription_expired', array( 'Groups_WS_Handler', 'subscription_expired' ), 10, 2 ); | |
} | |
} |