添加“插入按钮”在工具栏Tinymce编辑器上
我想在工具栏Tinymce编辑器上添加一个“插入按钮”。
我想要的一个示例:
使用工具栏按钮,我会喜欢在我的编辑器中创建一个按钮并更改其样式。 (就像Gutenberg编辑器一样)
使用Tinymce编辑器,我具有此代码:
function wpc_boutons_tinymce($buttons) {
$buttons[] = 'underline';
$buttons[] = 'fontselect';
$buttons[] = 'fontsizeselect';
$buttons[] = 'edit-block';
return $buttons;
}
add_filter("mce_buttons_3", "wpc_boutons_tinymce");
$content = '';
$editor_id = 'mycustomeditor';
$settings = array(
'wpautop' => false,
'media_buttons' => false,
'quicktags' => array(
'buttons' => 'strong,em,del,ul,ol,li,block,close'
),
);
wp_editor( $content, $editor_id, $settings );
我没有找到该怎么做,你能帮我吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我实施的代码,请按照步骤
粘贴主题中的代码 functions.php
在您的主题根文件中创建一个文件夹,名为 wptuts-editor buttons
然后在 wptuts-editor buttons 中创建一个名为 wptuts.php 的文件,然后粘贴代码
另外,您需要在 wptuts-editor buttons &gt中创建一个JS文件。 wptuts-plugin.js 并粘贴代码
整个解决方案我遵循了文章
Here is my implemented code Follow the step
Paste the code in your theme functions.php
Create a folder in your theme root file named wptuts-editor-buttons
Then create a file in wptuts-editor-buttons named wptuts.php and paste the code
Also, You need to create a js file in wptuts-editor-buttons > wptuts-plugin.js and paste the code
Whole the Solution I followed the article
https://code.tutsplus.com/tutorials/guide-to-creating-your-own-wordpress-editor-buttons--wp-30182