[wp-trac] [WordPress Trac] #35243: Extending the text widget to also allow visual mode
WordPress Trac
noreply at wordpress.org
Thu May 18 00:29:59 UTC 2017
#35243: Extending the text widget to also allow visual mode
---------------------------------------------+-----------------------------
Reporter: paaljoachim | Owner: westonruter
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.8
Component: Widgets | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch commit needs-dev-note | Focuses: ui,
| accessibility
---------------------------------------------+-----------------------------
Changes (by westonruter):
* status: reopened => closed
* resolution: => fixed
Comment:
@BackuPs no need to re-open the ticket.
This will be documented in a forthcoming dev-note, but here is a snippet
for adding a button:
{{{#!js
jQuery( document ).on( 'tinymce-editor-setup', function( event, editor ) {
editor.settings.toolbar1 += ',mybutton';
editor.addButton( 'mybutton', {
text: 'My button',
icon: false,
onclick: function () {
editor.insertContent(' <b>It\'s my
button!</b> ');
}
});
});
}}}
This is an adaptation of https://www.tinymce.com/docs/demo/custom-toolbar-
button/
Thanks to @azaozz for working out this example with me
[https://wordpress.slack.com/archives/C0381N237/p1495005750638280 over
Slack].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35243#comment:65>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list