Last active
February 20, 2018 19:32
-
-
Save kimcoleman/3aec607b09ed8541adda8be9786fc189 to your computer and use it in GitHub Desktop.
Add Shipping Address to membership checkout only if Addon Package is included for levels 4, 5, and 9 (for mono618).
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
<?php | |
/** | |
* Add Shipping Address to membership checkout only if Addon Package is included for levels 4, 5, and 9. | |
*/ | |
function hide_pmpro_shipping_level_4( $level_id ) { | |
if ( ! empty( $_REQUEST['ap'] ) ) { | |
$hideshipping = false; | |
} else { | |
$hideshipping = true; | |
} | |
return $hideshipping; | |
} | |
add_filter( 'pre_option_pmpro_shipping_hidden_level_4', 'hide_pmpro_shipping_level_4' ); | |
function hide_pmpro_shipping_level_5( $level_id ) { | |
if ( ! empty( $_REQUEST['ap'] ) ) { | |
$hideshipping = false; | |
} else { | |
$hideshipping = true; | |
} | |
return $hideshipping; | |
} | |
add_filter( 'pre_option_pmpro_shipping_hidden_level_5', 'hide_pmpro_shipping_level_5' ); | |
function hide_pmpro_shipping_level_9( $level_id ) { | |
if ( ! empty( $_REQUEST['ap'] ) ) { | |
$hideshipping = false; | |
} else { | |
$hideshipping = true; | |
} | |
return $hideshipping; | |
} | |
add_filter( 'pre_option_pmpro_shipping_hidden_level_9', 'hide_pmpro_shipping_level_9' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment