mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-14 04:06:36 +09:00
- fixed some typos and added escapers for SoundCloud Track field value;
This commit is contained in:
@@ -1003,10 +1003,10 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
),
|
||||
|
||||
'soundcloud' => array(
|
||||
'title' => __('SoundCloud','ultimate-member'),
|
||||
'title' => __( 'SoundCloud', 'ultimate-member' ),
|
||||
'metakey' => 'soundcloud',
|
||||
'type' => 'url',
|
||||
'label' => __('SoundCloud','ultimate-member'),
|
||||
'label' => __( 'SoundCloud', 'ultimate-member' ),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -1400,7 +1400,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
$array['numeric'] = __('Numeric value only','ultimate-member');
|
||||
$array['phone_number'] = __('Phone Number','ultimate-member');
|
||||
$array['skype'] = __('Skype ID','ultimate-member');
|
||||
$array['soundcloud'] = __('SoundCloud Profile','ultimate-member');
|
||||
$array['soundcloud'] = __( 'SoundCloud Profile', 'ultimate-member' );
|
||||
$array['twitter_url'] = __('Twitter URL','ultimate-member');
|
||||
$array['is_email'] = __('E-mail( Not Unique )','ultimate-member');
|
||||
$array['unique_email'] = __('Unique E-mail','ultimate-member');
|
||||
|
||||
@@ -23,31 +23,31 @@ add_filter( 'um_edit_label_all_fields', 'um_edit_label_all_fields', 10, 2 );
|
||||
|
||||
|
||||
/**
|
||||
* Outputs a soundcloud track
|
||||
* Outputs a SoundCloud track
|
||||
*
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @param string $value
|
||||
* @param array $data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function um_profile_field_filter_hook__soundcloud_track( $value, $data ) {
|
||||
|
||||
if ( !is_numeric( $value ) ) {
|
||||
if ( ! is_numeric( $value ) ) {
|
||||
# if we're passed a track url:
|
||||
if ( preg_match( '/https:\/\/soundcloud.com\/.*/', $value ) ) {
|
||||
$value = '<div class="um-soundcloud">
|
||||
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=' . urlencode($value) . '&color=ff6600&auto_play=false&show_artwork=true"></iframe>
|
||||
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=' . esc_attr( urlencode( $value ) ) . '&color=ff6600&auto_play=false&show_artwork=true"></iframe>
|
||||
</div>';
|
||||
return $value;
|
||||
} else {
|
||||
# neither a track id nor url:
|
||||
return __( 'Invalid soundcloud track ID', 'ultimate-member' );
|
||||
return __( 'Invalid SoundCloud track ID', 'ultimate-member' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# if we're passed a track id:
|
||||
$value = '<div class="um-soundcloud">
|
||||
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/' . $value . '&color=ff6600&auto_play=false&show_artwork=true"></iframe>
|
||||
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/' . esc_attr( $value ) . '&color=ff6600&auto_play=false&show_artwork=true"></iframe>
|
||||
</div>';
|
||||
|
||||
return $value;
|
||||
|
||||
Reference in New Issue
Block a user