Exemple #1
0
 /**
  * Clean up user inputted Periscope username value before saving the option
  *
  * @since 1.3.0
  *
  * @param string $username inputted Periscope username value
  *
  * @return string sanitized Periscope username value
  */
 public static function sanitize($username)
 {
     if (!is_string($username)) {
         return '';
     }
     $username = trim($username);
     if (!$username) {
         return '';
     }
     $username = sanitize_text_field($username);
     if (!$username) {
         return '';
     }
     return \Twitter\Helpers\Validators\PeriscopeUsername::sanitize($username);
 }