Php 我需要修复一个函数,它可以扫描WordPress post中的YouTube链接,并将链接放在一行上
任何一个可以修复该函数的函数吗? 此函数的工作方式与预期不同,它必须扫描WordPress帖子中的YouTube链接,并在链接末尾添加&w=480&rel=0,然后将链接放在一行上,这样它就可以与WordPress自动嵌入一起工作,如以下格式所示Php 我需要修复一个函数,它可以扫描WordPress post中的YouTube链接,并将链接放在一行上,php,wordpress,youtube,Php,Wordpress,Youtube,任何一个可以修复该函数的函数吗? 此函数的工作方式与预期不同,它必须扫描WordPress帖子中的YouTube链接,并在链接末尾添加&w=480&rel=0,然后将链接放在一行上,这样它就可以与WordPress自动嵌入一起工作,如以下格式所示 function the_content( $more_link_text = null, $strip_teaser = false) { $append = '&w=480&rel=0'; $content = ge
function the_content( $more_link_text = null, $strip_teaser = false) {
$append = '&w=480&rel=0';
$content = get_the_content( $more_link_text, $strip_teaser );
$content = apply_filters( 'the_content', $content );
$content = str_replace( ']]>', ']]>', $content );
$content = preg_replace('/^http:\/\/(?:www\.)?(?:youtube.com\/(?:v\/|watch[\/\#?])|(youtu\.be\/))[^\n\r]*/im', '$0'.$append, $content);
echo $content;
}
我有一种感觉,你昨天发布了这个,可能是用另一个帐户…我们可以问一下这个函数目前做什么吗?或者我们是想自己猜测或尝试,因为你不想自己花时间做这件事吗?salam@HamZa ya我昨天用错误的格式和信息发布了它,我用正确的方式重新发布了它如果我知道怎么做,我不会打扰你或任何其他人。。。这就是问题的含义@arkascha@ammsammwa aileikom elsalam,你真的需要尝试一下:(
blah blah blah
http://www.youtube.com/watch?v=yNNyzwSVRR0&w=480&rel=0
blah blah blah