我正在尝试更改插件中受密码保护的帖子上的内容。使用时content
过滤它似乎不起作用(重定向到wp-login.php会出现空白屏幕)。是否有更合适的过滤器?
我的当前代码:
function change_client_post_type($content) {
if(post_password_required()):
$content = get_the_password_form();
else:
...content
endif;
return $content;
}