让我们说自定义帖子类型中有以下文字:
{{something_here}} is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text
ever since the {{thanks_comment}}.
我知道我可以使用add_shortcode
执行某些操作并从那里创建内容,但有没有办法执行以下示例:
function create_content($placeholder_content = []){
$post_content = get_post($this_post_id);
//something to change the placeholder with the right content
//final logic
}
答案 0 :(得分:0)
如果链接有助于您创建过滤器,则需要创建新的内容过滤器并调用以下内容。
https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content