1

I'm trying to add a colorbutton in a tinymce dialog box, which i was able to do with the help of using this stackoverflow question here: https://stackoverflow.com/questions/23511566/adding-a-colorbutton-in-tinymce-dialog-with-api-4-x-doesnt-work

The problem is I need it to take the hex value thats selected and inject it into the shortcode. Here is a fiddle i made http://fiddle.tinymce.com/sZeaab it will add the shortcode like this: [shortcode color=''] but its missing the hex value. I need the shortcode to look like this: [shortcode color='#ffffff'] Also it changes the text color, which isn't what i want either, I am assuming its because of how I have this setup. Is what I'm doing the proper way to do this? Should this script be scrapped and re-wrote? I'm new to wordpress development, so any guidance would be appreciated, since I really don't know what I'm doing when it comes to TinyMCE. Let me know if you need further explanation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.