- added a discord field (issue #926)

This commit is contained in:
ashubawork
2021-12-13 12:52:36 +02:00
parent 4e90ec5502
commit ff18aa5ec7
3 changed files with 38 additions and 0 deletions
+18
View File
@@ -284,6 +284,24 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
}
/**
* Is Discord ID
*
* @param $string
*
* @return bool
*/
public function is_discord_id( $string ) {
if ( ! $string ) {
return true;
}
if ( ! preg_match( '/(^\S+)#(\d+)$/', trim( $string ) ) ) {
return false;
}
return true;
}
/**
* Is url
*