Instantly share code, notes, and snippets.

What would you like to do?
Remove State Field from MemberPress Signup Forms
//Remove the State Field completely
function trim_down_address_fields($options) {
foreach($options->address_fields as $i => $o) {
if($o->field_key == 'mepr-address-state') {
return $options;
add_filter('mepr_fetch_options', 'trim_down_address_fields');
//Add a fake state value to each user
function populate_state_field($event) {
$user = $event->get_data();
update_user_meta($user->ID, 'mepr-address-state', 'fake');
add_action('mepr-event-login', 'populate_state_field');

This comment has been minimized.


cartpauj commented Oct 3, 2018

The above code can be installed in a plugin like Code Snippets or My Custom Functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment