- updated comments;

This commit is contained in:
Mykyta Synelnikov
2023-09-22 16:50:51 +03:00
parent 5fd11374a7
commit 45a22f371e
+5 -7
View File
@@ -1906,17 +1906,16 @@ function um_profile( $key ) {
return $value;
}
/**
* Get youtube video ID from url
* Get YouTube video ID from URL.
*
* @param $url
* @param string $url
*
* @return bool
* @return bool|string
*/
function um_youtube_id_from_url( $url ) {
$url = preg_replace( '/&ab_channel=.*/', '', $url );
$url = preg_replace( '/\?si=.*/', '', $url );
$url = preg_replace( '/&ab_channel=.*/', '', $url ); // ADBlock argument.
$url = preg_replace( '/\?si=.*/', '', $url ); // referral attribute.
$pattern =
'%^# Match any youtube URL
@@ -1943,7 +1942,6 @@ function um_youtube_id_from_url( $url ) {
return false;
}
/**
* Find closest number in an array
*