在自定义帖子类型WordPress中创建占位符?

时间:2015-10-09 09:08:10

标签: php wordpress

让我们说自定义帖子类型中有以下文字:

{{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
}

1 个答案:

答案 0 :(得分:0)

如果链接有助于您创建过滤器,则需要创建新的内容过滤器并调用以下内容。

  

https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content