【发布时间】:2017-05-04 07:16:49
【问题描述】:
我正在尝试为我的 wordpress 安装设置一个新的 http 标头,但我无法在我的新 wp_headers 过滤器函数中使用 $post 对象。我想为不同的帖子类型发送不同的标题,并使用 Go(lang) 来缓存东西(家庭项目)。
function add_new_header($headers) {
$headers['PostId'] = get_the_ID();
return $headers;
}
add_filter('wp_headers', 'add_new_header');
【问题讨论】:
标签: php wordpress http-headers