Question

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

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

Était-ce utile?

La solution

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();",
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top