plugins - Add button gutenberg help

Hello I need to add a button to the toolbar gutenberg I found this but I do not get what is wrong for the button to a

Hello I need to add a button to the toolbar gutenberg I found this / but I do not get what is wrong for the button to appear

functions.php

my-custom-format.js

( function( wp ) {
    var MyCustomButton = function( props ) {
        return wp.element.createElement(
            wp.editor.RichTextToolbarButton, {
                icon: 'editor-code',
                title: 'Sample output',
                onClick: function() {
                    console.log( 'toggle format' );
                },
            }
        );
    }
    wp.richText.registerFormatType(
       'my-custom-format/sample-output', {
            title: 'Sample output',
            tagName: 'samp',
            className: null,
            edit: MyCustomButton,
        }
    );
} )( window.wp );

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742303552a4418491.html

相关推荐

  • plugins - Add button gutenberg help

    Hello I need to add a button to the toolbar gutenberg I found this but I do not get what is wrong for the button to a

    15小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信