1
想阻止包含非https網址的oEmbed請求,但以下代碼無法幫助我。不知道這是否是正確的選擇。有任何想法嗎?如何屏蔽WordPress oEmbed HTTP網址
add_filter('pre_oembed_result', array($this, 'filter_oembed'), 5, 3);
function filter_oembed ($result, $url, $args) {
if (substr($url, 0, 7) === "http://") {
return null;
}
}
我使用Wordpress 4.7.2。
感謝鏈接你包括幫助..在你的答案應該返回false而不是返回null! – srvy
好的,已更新。我不確定... – miken32