if(!function_exists('jma_yt_detect_shortcode')){
function jma_yt_detect_shortcode( $needle = '', $post_item = 0 ){
if($post_item){
if(is_object($post_item))
$post = $post_item;
else
$post = get_post($post_item);
}else{
global $post;
}
if(is_array($needle))
$pattern = get_shortcode_regex($needle);
elseif(is_string($needle))
$pattern = get_shortcode_regex(array($needle));
else
$pattern = get_shortcode_regex();
preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches );
if(//if shortcode(s) to be searched for were passed and not found $return false
array_key_exists( 2, $matches ) &&
count( $matches[2] )
){
$return = $matches;
}else{
$return = false;
}
return $return;
}
}