public static function sanitizeShortcodeParameters($attributes = array())
{
if (!is_array($attributes)) {
return array();
}
$options = array();
if (isset($attributes['username'])) {
$username = \Twitter\Helpers\Validators\PeriscopeUsername::trim($attributes['username']);
if ($username) {
$options['username'] = $username;
}
unset($username);
}
// large is the only option
if (isset($attributes['size'])) {
if (is_string($attributes['size']) && in_array(strtolower($attributes['size']), array('large', 'l'))) {
$options['size'] = 'large';
}
}
return $options;
}