admin管理员组文章数量:1130349
Just updated WordPress to new 3.9, new features are great, love them. Only got some issues with tinyMCE 4. I use wp_editor to create multiple tinyMCE editors with custom field.
Here is the code:
$tinymce_opt = array(
'height' => "250",
'plugins' => "nz_button, line, gap, slider_colorbox, icon_list, icons, font_size",
'toolbar1' => "formatselect,fontselect, styleselect,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,forecolor,removeformat,charmap,undo,redo",
'toolbar2' => "nz_button, line, gap, slider_colorbox, icon_list, icons, font_size",
'toolbar3' => ""
);
$settings = array (
'tinymce' => $tinymce_opt
);
wp_editor( ${"layer_$i"}, "layer_$i", $settings);
Everything is fine. The problem is that it does not understand plugins (my custom shortcodes, that i created). Custom shortcodes work fine in regular wp editor, but in multiple wp_editor, it just does not find them.
In colsole i get error 404 can’t find
for example “line” shortcode
.min.js 404 (Not Found)
All my custom shortcodes are ignored, not found.
Does anyone know, how to tell tinyMCE + wp_editor to use custom shortcodes?
My custom shortcodes are located in my theme
P.S. It worked fine with old tinyMCE.
Just updated WordPress to new 3.9, new features are great, love them. Only got some issues with tinyMCE 4. I use wp_editor to create multiple tinyMCE editors with custom field.
Here is the code:
$tinymce_opt = array(
'height' => "250",
'plugins' => "nz_button, line, gap, slider_colorbox, icon_list, icons, font_size",
'toolbar1' => "formatselect,fontselect, styleselect,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,forecolor,removeformat,charmap,undo,redo",
'toolbar2' => "nz_button, line, gap, slider_colorbox, icon_list, icons, font_size",
'toolbar3' => ""
);
$settings = array (
'tinymce' => $tinymce_opt
);
wp_editor( ${"layer_$i"}, "layer_$i", $settings);
Everything is fine. The problem is that it does not understand plugins (my custom shortcodes, that i created). Custom shortcodes work fine in regular wp editor, but in multiple wp_editor, it just does not find them.
In colsole i get error 404 can’t find
for example “line” shortcode
http://mywebsite/wp-includes/js/tinymce/plugins/line/plugin.min.js 404 (Not Found)
All my custom shortcodes are ignored, not found.
Does anyone know, how to tell tinyMCE + wp_editor to use custom shortcodes?
My custom shortcodes are located in my theme
P.S. It worked fine with old tinyMCE.
Share Improve this question edited Apr 23, 2014 at 10:56 Mayeenul Islam 12.9k21 gold badges85 silver badges169 bronze badges asked Apr 23, 2014 at 10:28 shagalshagal 11 bronze badge 2 |1 Answer
Reset to default 1Since 3.9 some parts of the settings for the original Editor are wrapped in a self::first_init condition. This includes the plugins filter for external tinymce plugins.
So, in a subsequent call for an editor, the filter won't run.
Solution: One can pass a tinymce settings array to the settings of wp_editor(), that's where I would start. Or enqueue the script manually as explained here:
http://www.tinymce/wiki.php/Tutorials:Creating_a_plugin
Just updated WordPress to new 3.9, new features are great, love them. Only got some issues with tinyMCE 4. I use wp_editor to create multiple tinyMCE editors with custom field.
Here is the code:
$tinymce_opt = array(
'height' => "250",
'plugins' => "nz_button, line, gap, slider_colorbox, icon_list, icons, font_size",
'toolbar1' => "formatselect,fontselect, styleselect,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,forecolor,removeformat,charmap,undo,redo",
'toolbar2' => "nz_button, line, gap, slider_colorbox, icon_list, icons, font_size",
'toolbar3' => ""
);
$settings = array (
'tinymce' => $tinymce_opt
);
wp_editor( ${"layer_$i"}, "layer_$i", $settings);
Everything is fine. The problem is that it does not understand plugins (my custom shortcodes, that i created). Custom shortcodes work fine in regular wp editor, but in multiple wp_editor, it just does not find them.
In colsole i get error 404 can’t find
for example “line” shortcode
.min.js 404 (Not Found)
All my custom shortcodes are ignored, not found.
Does anyone know, how to tell tinyMCE + wp_editor to use custom shortcodes?
My custom shortcodes are located in my theme
P.S. It worked fine with old tinyMCE.
Just updated WordPress to new 3.9, new features are great, love them. Only got some issues with tinyMCE 4. I use wp_editor to create multiple tinyMCE editors with custom field.
Here is the code:
$tinymce_opt = array(
'height' => "250",
'plugins' => "nz_button, line, gap, slider_colorbox, icon_list, icons, font_size",
'toolbar1' => "formatselect,fontselect, styleselect,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,forecolor,removeformat,charmap,undo,redo",
'toolbar2' => "nz_button, line, gap, slider_colorbox, icon_list, icons, font_size",
'toolbar3' => ""
);
$settings = array (
'tinymce' => $tinymce_opt
);
wp_editor( ${"layer_$i"}, "layer_$i", $settings);
Everything is fine. The problem is that it does not understand plugins (my custom shortcodes, that i created). Custom shortcodes work fine in regular wp editor, but in multiple wp_editor, it just does not find them.
In colsole i get error 404 can’t find
for example “line” shortcode
http://mywebsite/wp-includes/js/tinymce/plugins/line/plugin.min.js 404 (Not Found)
All my custom shortcodes are ignored, not found.
Does anyone know, how to tell tinyMCE + wp_editor to use custom shortcodes?
My custom shortcodes are located in my theme
P.S. It worked fine with old tinyMCE.
Share Improve this question edited Apr 23, 2014 at 10:56 Mayeenul Islam 12.9k21 gold badges85 silver badges169 bronze badges asked Apr 23, 2014 at 10:28 shagalshagal 11 bronze badge 2-
What is the actual value of
${"layer_$i"}? – fuxia ♦ Commented Apr 23, 2014 at 10:30 - I don't have an answer for your question, but I wanted to point out that the text alignment button names have changed (possibly without warning... grrrr) in WordPress 3.9. You'll need to change "justifyleft,justifycenter,justifyright" to "alignleft,aligncenter,alignright". – Andy Giesler Commented May 15, 2014 at 15:25
1 Answer
Reset to default 1Since 3.9 some parts of the settings for the original Editor are wrapped in a self::first_init condition. This includes the plugins filter for external tinymce plugins.
So, in a subsequent call for an editor, the filter won't run.
Solution: One can pass a tinymce settings array to the settings of wp_editor(), that's where I would start. Or enqueue the script manually as explained here:
http://www.tinymce/wiki.php/Tutorials:Creating_a_plugin
本文标签: TinyMCE 4 amp wpeditor multiple editor issue
版权声明:本文标题:TinyMCE 4 & wp_editor multiple editor issue 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749093302a2314858.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


${"layer_$i"}? – fuxia ♦ Commented Apr 23, 2014 at 10:30