Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save femiyb/a7b1741e6cff0342cd685d2d308e7fef to your computer and use it in GitHub Desktop.
Save femiyb/a7b1741e6cff0342cd685d2d308e7fef to your computer and use it in GitHub Desktop.
Remove the Phone field from the required billing fields for PMPro checkout.
<?php
/**
* This recipe can be used to remove the Phone and Address 2 fields
* from the required billing fields for checkout.
*
* Note: Make sure your Gateway doesn't require it also.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function pmpro_dont_require_billing_fields( $fields ) {
unset( $fields['bphone'] );
return $fields;
}
add_filter( 'pmpro_required_billing_fields', 'pmpro_dont_require_billing_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment