tinyMCE.execCommand. What command do I need to insert to call charmap

I need some help. I try to insert charmap button in fullscreen mode on wordpress, but I don’t know, what I should write bettwen brackets. Usually to insert another buttons I wrote code like this:

function enable_more_buttons( $buttons ) {
    $buttons['wp_more'] = array(
        'title' => __('wp_more'),
        'onclick' => "tinyMCE.execCommand('WP_More');",
        'both' => false
    );
    return $buttons;
}

add_filter('wp_fullscreen_buttons', 'enable_more_buttons');

I guess, Now I should change it

Read More
function enable_more_buttons( $buttons ) {
    $buttons['wp_more'] = array(
        'title' => __('wp_more'),
        'onclick' => "tinyMCE.execCommand('WP_More');",
        'both' => false
    );
    $buttons['charmap'] = array(
        'title' => __("charmap"),
        'onclick' => "tinyMCE.execCommand('--SOMETHING HERE---');",
        'both' => false
    );
    return $buttons;
}

add_filter('wp_fullscreen_buttons', 'enable_more_buttons');

Help me please

Related posts

Leave a Reply

1 comment

  1. There is no command for the charmap afaik.

    But you could call click on the charmap-button instead of using the execCommand:

    'onclick' => "$('.mce-i-charmap').parent().click();",