Hi, @corrinarusso!
Thank you so much for your answer. I’ve seen how to add a label when creating a custom button. But I need to add a label for a button that already exists in the TinyMCE, do you know if this is possible?
Thanks.
Hi @juliamb ,
Are you already using a custom API call to the editor? Or are do you mean you want to add text to the default WordPress wysiwg? Can you provide a screenshot to be clear?
I’m using BuddyPress Docs plugin, to add extra functionality to Buddy Press. This plugin has a TinyMCE editor with the default buttons, edit text, add a link, etc. These buttons only have an icon and a title, that shows up when you hover them.
What I want is to add a text next to some of these buttons.
Should I ask on the BuddyPress Docs plugin support forum instead of doing it here?
Personally I would not recommend “adding texting next to some of the buttons”.
I would just replace the icon that displays on the button with the text.
This plugin uses this method to apply the Print button to the wysiwyg :
https://developer.wordpress.org/reference/hooks/mce_buttons/
in this file :
/wp-content/plugins/buddypress-docs/includes/templatetags-edit.php
imo, this isn’t really a great method. Did you try this first ?
https://en-ca.wordpress.org/plugins/tinymce-advanced/
Here is a straightfoward method to actually convert the tooltip to a display of the text :
https://wordpress.stackexchange.com/questions/157949/create-special-button-on-wp-tiny-mce-posts-editor-for-shortcodes
It may be a good workaround in this case.
Otherwise, you’ll need to convert the existing button array from the -docs plugin here :
$ks = array_pop( $buttons );
$buttons = array_merge( $buttons, array( 'print' ), array( $ks ) );
like this :
https://www.gavick.com/blog/wordpress-tinymce-custom-buttons
Thank you so much for all the information, @corrinarusso!
I will check this out.
Regards.