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