Php Wordpress wp_编辑器括号错误解决方法

Php Wordpress wp_编辑器括号错误解决方法,php,wordpress,wysiwyg,Php,Wordpress,Wysiwyg,我试图让所见即所得编辑器在自定义选项页面上工作。 但我不允许使用方括号作为编辑器id 这是我目前正在使用的代码。 (以此为起点:) 有人能给我解释一下怎么让它工作吗? 使用当前代码,我只能获得带有quicktags的wysiwyg编辑器。如果我将$editor\u id重命名为纯文本,我可以获得完整的编辑器,但它不会保存。我终于让它正常工作了 这就是为什么: <?php $content = $options['som

我试图让所见即所得编辑器在自定义选项页面上工作。 但我不允许使用方括号作为编辑器id

这是我目前正在使用的代码。 (以此为起点:)


有人能给我解释一下怎么让它工作吗?
使用当前代码,我只能获得带有quicktags的wysiwyg编辑器。如果我将$editor\u id重命名为纯文本,我可以获得完整的编辑器,但它不会保存。

我终于让它正常工作了

这就是为什么:

                <?php

                $content =  $options['sometextarea'];
                $editor_id = 'sometextarea';

                $settings =   array(
                    'wpautop' => false, 
                    'media_buttons' => false, 
                    'textarea_name' => 'mythemename_theme_options[sometextarea]', //You can use brackets here !
                    'textarea_rows' => get_option('default_post_edit_rows', 10), 
                    'tabindex' => '323',
                    'editor_css' => '', 
                    'editor_class' => '',
                    'teeny' => false, 
                    'dfw' => false,
                    'tinymce' => true, 
                    'quicktags' => true 
                );
                wp_editor( $content , $editor_id, $settings  );

                ?>

我终于让它正常工作了

这就是为什么:

                <?php

                $content =  $options['sometextarea'];
                $editor_id = 'sometextarea';

                $settings =   array(
                    'wpautop' => false, 
                    'media_buttons' => false, 
                    'textarea_name' => 'mythemename_theme_options[sometextarea]', //You can use brackets here !
                    'textarea_rows' => get_option('default_post_edit_rows', 10), 
                    'tabindex' => '323',
                    'editor_css' => '', 
                    'editor_class' => '',
                    'teeny' => false, 
                    'dfw' => false,
                    'tinymce' => true, 
                    'quicktags' => true 
                );
                wp_editor( $content , $editor_id, $settings  );

                ?>

我终于让它正常工作了

这就是为什么:

                <?php

                $content =  $options['sometextarea'];
                $editor_id = 'sometextarea';

                $settings =   array(
                    'wpautop' => false, 
                    'media_buttons' => false, 
                    'textarea_name' => 'mythemename_theme_options[sometextarea]', //You can use brackets here !
                    'textarea_rows' => get_option('default_post_edit_rows', 10), 
                    'tabindex' => '323',
                    'editor_css' => '', 
                    'editor_class' => '',
                    'teeny' => false, 
                    'dfw' => false,
                    'tinymce' => true, 
                    'quicktags' => true 
                );
                wp_editor( $content , $editor_id, $settings  );

                ?>

我终于让它正常工作了

这就是为什么:

                <?php

                $content =  $options['sometextarea'];
                $editor_id = 'sometextarea';

                $settings =   array(
                    'wpautop' => false, 
                    'media_buttons' => false, 
                    'textarea_name' => 'mythemename_theme_options[sometextarea]', //You can use brackets here !
                    'textarea_rows' => get_option('default_post_edit_rows', 10), 
                    'tabindex' => '323',
                    'editor_css' => '', 
                    'editor_class' => '',
                    'teeny' => false, 
                    'dfw' => false,
                    'tinymce' => true, 
                    'quicktags' => true 
                );
                wp_editor( $content , $editor_id, $settings  );

                ?>

这个问题是由
$editor\u id
参数引起的,所以给它一个没有括号的名称[],这样就不用
my\u text\u area\u id.['textarea']
了,只要给它一个普通的id,比如
my textarea id
,它就可以工作了

wp_editor( 

   string $content, 

    string $editor_id, 

   array $settings = array() 
);

Ref:

这个问题是由
$editor\u id
参数引起的,所以给它一个没有括号的名称[],这样就不用
my\u text\u area\u id.['textarea']
了,只要给它一个普通的id,比如
my textarea id
,它就可以工作了

wp_editor( 

   string $content, 

    string $editor_id, 

   array $settings = array() 
);

Ref:

这个问题是由
$editor\u id
参数引起的,所以给它一个没有括号的名称[],这样就不用
my\u text\u area\u id.['textarea']
了,只要给它一个普通的id,比如
my textarea id
,它就可以工作了

wp_editor( 

   string $content, 

    string $editor_id, 

   array $settings = array() 
);

Ref:

这个问题是由
$editor\u id
参数引起的,所以给它一个没有括号的名称[],这样就不用
my\u text\u area\u id.['textarea']
了,只要给它一个普通的id,比如
my textarea id
,它就可以工作了

wp_editor( 

   string $content, 

    string $editor_id, 

   array $settings = array() 
);

Ref:

考虑使用编辑器编辑数据,但保存时将输出转储到自定义的隐藏文本区域。这肯定会让你绕过方括号的限制。不过有点脏。我觉得这是个可行的解决办法。唯一的问题是我不知道该怎么做。我让它以相反的方式工作,textarea->wysiwyg。或者使用您自己的代码,您需要“代码> TyMyCE”。对于VisualEdgor,获取(EdgRooSoID).GETCopTeNo.()/<代码>和“代码> jQuery('Ay''+TeXTaRayaId).Valuor(<代码)>文本编辑器。考虑使用编辑器编辑数据,但在保存时将输出转储到自定义的隐藏文本中。这肯定会让你绕过方括号的限制。不过有点脏。我觉得这是个可行的解决办法。唯一的问题是我不知道该怎么做。我让它以相反的方式工作,textarea->wysiwyg。或者使用您自己的代码,您需要“代码> TyMyCE”。对于VisualEdgor,获取(EdgRooSoID).GETCopTeNo.()/<代码>和“代码> jQuery('Ay''+TeXTaRayaId).Valuor(<代码)>文本编辑器。考虑使用编辑器编辑数据,但在保存时将输出转储到自定义的隐藏文本中。这肯定会让你绕过方括号的限制。不过有点脏。我觉得这是个可行的解决办法。唯一的问题是我不知道该怎么做。我让它以相反的方式工作,textarea->wysiwyg。或者使用您自己的代码,您需要“代码> TyMyCE”。对于VisualEdgor,获取(EdgRooSoID).GETCopTeNo.()/<代码>和“代码> jQuery('Ay''+TeXTaRayaId).Valuor(<代码)>文本编辑器。考虑使用编辑器编辑数据,但在保存时将输出转储到自定义的隐藏文本中。这肯定会让你绕过方括号的限制。不过有点脏。我觉得这是个可行的解决办法。唯一的问题是我不知道该怎么做。我让它以相反的方式工作,textarea->wysiwyg。或者使用您自己的代码,您希望可视化编辑器使用
tinyMCE.get(editor_id).getContent()
,文本编辑器使用
jQuery('#'+textarea_id).val()
。您知道在客户端
tinyMCE.get(“mythmename\u主题选项[sometextarea]”。getContent()
是否仍然有效?我认为tinyMCE 4.x不能与包含括号的id一起工作?因此代码需要与
name
属性不同的
id
,对吗?您知道在客户端
tinyMCE.get(“Mythmename\u theme\u options[sometextarea]”。getContent()?我认为tinyMCE 4.x不能与包含括号的id一起工作?因此代码需要与
name
属性不同的
id
,对吗?您知道在客户端
tinyMCE.get(“Mythmename\u theme\u options[sometextarea]”。getContent()?我认为tinyMCE 4.x不能与包含括号的id一起工作?因此代码需要与
name
属性不同的
id
,对吗?您知道在客户端
tinyMCE.get(“Mythmename\u theme\u options[sometextarea]”。getContent()?我认为tinyMCE 4.x不能与包含括号的id一起工作?因此代码要求具有与
name
属性不同的
id
,对吗?