Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将默认内容添加到wp_编辑器_Php_Wordpress - Fatal编程技术网

Php 将默认内容添加到wp_编辑器

Php 将默认内容添加到wp_编辑器,php,wordpress,Php,Wordpress,我需要知道如何在查看wp_编辑器时添加几个段落。我正在使用一个PHP代码片段插件在前端显示wp_编辑器&需要在编辑器加载时添加一些指令文本 代码: wp_editor( $distribution, 'distribution', array( 'theme_advanced_buttons1' => 'bold, italic, ul, pH, pH_min', "media_buttons" => false, "textarea_rows" => 15, "tabinde

我需要知道如何在查看wp_编辑器时添加几个段落。我正在使用一个PHP代码片段插件在前端显示wp_编辑器&需要在编辑器加载时添加一些指令文本

代码:

wp_editor( $distribution, 'distribution', array( 'theme_advanced_buttons1' => 'bold, italic, ul, pH, pH_min', "media_buttons" => false, "textarea_rows" => 15, "tabindex" => 4 ) ); 
有人能帮我吗


干杯

您可以使用此功能

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);

您使用的是Divi编辑器还是其他自定义编辑器,或者只是默认的WP编辑器?我使用的是启用了微型MCE插件的默认编辑器。Thanks@Anna惠灵顿问题解决了没有