Home / Archive / MemberPress: Remove all states to the dropdown list and leave one fake state
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Remove all states to the dropdown list and leave one fake state

This code snippet will add a fake state, practically disabling the State address field. This will allow the collection of the information necessary for tax calculations without the need to collect users' personal information.

The code snippet will remove all states from the State field dropdown list, and leave the fake state as the only selection.

Code Preview
php
<?php
function mepr_remove_states( $states ) {
  return array( 'US' => array(
    'BU' => _x( 'Fake State', 'ui', 'memberpress' )
  ) );
}
add_filter( 'mepr_states', 'mepr_remove_states', 20, 2 );

Comments

Add a Comment