我想在页面编辑器上添加按钮,并在新的WordPress Gutenberg编辑器中发布文本编辑器

问题描述 投票:0回答:1

我想在页面编辑器上添加按钮,并在新的WordPress版本中发布文本编辑器

我正在使用此代码在word press中添加页面按钮和post editor。

add_action('media_buttons','wpbeautify_add_sc_select',11);
function wpbeautify_add_sc_select(){
    echo '<a title="FotoPress" data-editor="content" class="button" id="wpbeautify-editor-button" href="#"><img src="'.WPBEAUTIFY_URL.'/img/icons/logo.png"> FotoPress</a>';
}

你能帮我解决这个问题吗?

wordpress hook wordpress-gutenberg
1个回答
0
投票

使用WordPress 5和Gutenberg,媒体按钮不再存在。您可能需要做的是为您的媒体类型创建一个新块。我建议以Gutenberg Block API Referencehow the core/image block was implemented为指导。

© www.soinside.com 2019 - 2024. All rights reserved.