Buddypress user registration validation not working with custom select query
There is no such thing as $bp->get_var. Try using $wpdb->get_var. Or try this: function validate_user_signup($result) { global $wpdb; $result = $wpdb->get_var(“SELECT user_id FROM wp_bp_xprofile_data WHERE value=”{$_POST[“field_2′]}'”); if( $result != NULL ){ $new_error = new WP_Error(); $new_error->add( ‘field_2’, __( ‘Phone number is already in use.’, ‘buddypress’ ) ); $result[‘errors’] = $new_error; } return $result; } add_filter(‘bp_core_validate_user_signup’, … Read more