我需要知道在查看wp_editor时如何添加几个段落。我正在使用PHP片段插件在前端显示wp_editor,并且在加载编辑器时需要添加一些指令文本。
代码:
wp_editor( $distribution, 'distribution', array( 'theme_advanced_buttons1' => 'bold, italic, ul, pH, pH_min', "media_buttons" => false, "textarea_rows" => 15, "tabindex" => 4 ) );
有人可以帮助我吗?
欢呼
答案 0 :(得分:2)
您可以使用此功能
add_filter('default_content', 'my_editor_content');
function my_editor_content( $content ) {
$content = "If you enjoyed this post, make sure to subscribe to my rss feed.<br>This goes on the second line";
return $content;
}
或者您可以使用
if($content == ""){
$content = "default content";
}
wp_editor( string $content, string $editor_id);