Disable Login by Email
remove_filter( ‘authenticate’, ‘wp_authenticate_email_password’, 20 );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
remove_filter( ‘authenticate’, ‘wp_authenticate_email_password’, 20 );Continue reading
add_filter( ‘use_widgets_block_editor’, ‘__return_false’ );Continue reading
add_shortcode(‘bandcamp’, function($attr=[]){ $attr = shortcode_atts([ ‘width’ => 350, ‘height’ => 470, ‘album’ => null, ‘title’ => null, ‘size’ => ‘large’, ‘bgcol’ => ‘ffffff’, ‘url’ => null, ‘linkcol’ => ‘0687f5’, ‘tracklist’ => ‘false’, ‘title’ => null, ‘artwork’ => null, ], $attr);…Continue reading
/** * Lock user out after a period of inactivity with customizable timeout and warning notification. */ // Add settings for inactivity timeout add_action(‘admin_init’, ‘register_inactivity_timeout_setting’); function register_inactivity_timeout_setting() { register_setting(‘general’, ‘inactivity_timeout’, [ ‘type’ => ‘integer’, ‘description’ => ‘Inactivity timeout duration in…Continue reading
function mepr_order_bumps_desc() { ?>Continue reading
function mepr_limit_phone_digits( $errors ) { $phone = isset( $_POST[‘mepr_phone_number’] ) ? sanitize_text_field(trim($_POST[‘mepr_phone_number’])) : ”; // Remove all non-numeric characters from the phone number. $phone = preg_replace(“/[^0-9]/”, “”, $phone); // Check if phone digits equal 11 if (strlen($phone) != 11) {…Continue reading
add_action(‘wp_head’, function() { ?>Continue reading
function mepr_remove_states( $states ) { return array( ‘US’ => array( ‘BU’ => _x( ‘Fake State’, ‘ui’, ‘memberpress’ ) ) ); } add_filter( ‘mepr_states’, ‘mepr_remove_states’, 20, 2 );Continue reading
function limit_signups_to_one_country( $errors ) { // Check if the country field is set and if the country is not UK if( !isset( $_POST[‘mepr-address-country’] ) || $_POST[‘mepr-address-country’] != ‘GB’ ) { $errors[] = ‘Sorry, signups are currently limited to UK only.’;…Continue reading
function mepr_custom_limit_signups_by_state( $errors ) { $usr_country = sanitize_text_field( $_POST[‘mepr-address-country’] ); $usr_state = sanitize_text_field( $_POST[‘mepr-address-state’] ); $exclude_states = array(‘AK’); //Change this as needed or you can do a comma seperated list of state abbr. //If state in excluded list throw error…Continue reading