OK, I just tried to embed multiple Videos and I get the error
"Fatal error: Call to undefined function getIdFromUrl()" ... lol... I read above about the error if you don’t have the if statement before the function, I can also reproduce that, gives me:
"Fatal error: Cannot redeclare getidfromurl()" without the
if ( ! function_exists( 'getIdFromUrl' ) ) {}
so I implemented this one and now it looks like this, but I get the above "Call to undefined func..." error...wtf...I also tried
if( ! defined('getIdFromUrl')) { } from the post above, but this didn’t change anything...still geht the "call to undefined func" error
if ( ! function_exists( 'getIdFromUrl' ) ) {
function getIdFromUrl($url) {
$url_parts = parse_url($url);
parse_str($url_parts['query']);
if(isset($v)) {
return $v;
} else {
return false;
}
}
}
what is wrong with that??
I also took the whole Snippet code above and copied it into my snippet but it gave me the exact same errors...I don’t get it...any ideas?
thanks for any advice!
EDIT: Really strange but I got it...I just moved the whole function from the bottom to the top of the snippet code...now it works^^