Created
February 20, 2023 23:43
-
-
Save PUYUP/1806b5824fe56ce87681ac94232ea408 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rest_pre_echo_response_handler( $result, $served, $request ) { | |
$code = ( isset( $result['code'] ) && ! empty( $result['code'] ) ) ? $result['code'] : ''; | |
// Username exist | |
switch ( $code ) { | |
case 'existing_user_login': | |
$result['message'] = __( 'Sorry, that phone number already exists!' ); | |
break; | |
} | |
return $result; | |
} | |
add_filter( 'rest_pre_echo_response', 'rest_pre_echo_response_handler', 99, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment