Forked from andrewlimaza/billing-fields-optional.php
Last active
October 10, 2019 13:27
-
-
Save femiyb/5b667588ecba79a5912382975c0724a4 to your computer and use it in GitHub Desktop.
Make billing details optional for Paid Memberships Pro
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 lines 4-15 to your custom plugin or functions.php of your active theme | |
function pmpro_remove_bfields( $pmpro_required_billing_fields ){ | |
//remove field ID's from array to make fields required | |
$remove_field = array('bphone'); | |
//loop through the $remove_field array and unset each billing field to make it optional. | |
foreach($remove_field as $field){ | |
unset($pmpro_required_billing_fields[$field]); | |
} | |
return $pmpro_required_billing_fields; | |
} | |
add_filter('pmpro_required_billing_fields', 'pmpro_remove_bfields'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment