MemberPress: Add/Override State Drop Down Values

function mepr_change_state_dropdown_values ( $states ) { $sfiles = @glob( WP_PLUGIN_DIR . ‘/mepr-i18n/states/[A-Z][A-Z].php’, GLOB_NOSORT ); foreach( $sfiles as $sfile ) { require( $sfile ); } return $states; } add_filter( ‘mepr_states’, ‘mepr_change_state_dropdown_values’ );Continue reading

MemberPress: Set the order of payment methods

function mepr_rearrange_payment_methods( $payment_methods, $key ) { //Modify the order of the payment methods below according to your needs. You can also remove non needed payment methods $order = array( “PayPal Standard”, “Stripe”, “Authorize.net Profile”, “Offline Payment”, ); $pm_map = array();…Continue reading

MemberPress: Set Custom Product Pages

function mepr_is_product_page( $return, $post ) { $custom_pages = array( 1, 2, 3 ); //Replace these numbers with the post ID’s of the pages if( isset( $post ) && in_array( $post->ID, $custom_pages ) ) { return true; } return $return; }…Continue reading

MemberPress: Disable Address Fields for a Specific Membership

function mepr_disable_address_fields( $fields ) { if ( is_single( array( 12, 564 ) ) ) { $hide_fields = array( ‘mepr-address-state’, ‘mepr-address-zip’, ‘mepr-address-one’, ‘mepr-address-two’, ‘mepr-address-city’, ‘mepr-address-country’, ); foreach ( $fields as $key => $field ) { if ( isset( $field->field_key ) &&…Continue reading

MemberPress: Remove all but nine countries from the drop-down

function mepr_remove_countries( $countries, $prioritize_my_country ) { return array( ‘AU’ => _x( ‘Australia’, ‘ui’, ‘memberpress’ ), ‘CA’ => _x( ‘Canada’, ‘ui’, ‘memberpress’ ), ‘DK’ => _x( ‘Denmark’, ‘ui’, ‘memberpress’ ), ‘FR’ => _x( ‘France’, ‘ui’, ‘memberpress’ ), ‘DE’ => _x( ‘Germany’,…Continue reading