
- #Wordpress tinymce windowmanager code
- #Wordpress tinymce windowmanager download
- #Wordpress tinymce windowmanager free
This function basically gives WordPress the path to our JS file (which we will create next) so that TinyMCE can use it and load our plugin. The next task we want to do is make the dobsondev_tinymce_example_add_tinymce_plugin function that we call in our main function (it’s the first add_filter( … ) call). For this plugin I opted to put all the buttons on the third row to differentiate them from the rest of the default buttons but you can change that number to change the row.Ĭhange the number in mce_buttons_ to change the row the buttons appear in Adding the Plugin File to TinyMCE This denotes the row that the buttons will appear on. One very important thing to note is the number 3 at the end of mce_buttons_3 in the add_filter( ‘mce_buttons_3’, ‘dobsondev_tinymce_example_register_buttons’ ) call.
#Wordpress tinymce windowmanager code
You can see the code below:Īfter this main function we only have to create the two functions that we call in our add_filter( … ) function calls before we are done with our main plugin file. This function is added as an action to the admin_head since we only need to load our plugin when editing a post or page which takes place on the admin side. The first three steps are done with simple checks and the one is done by simply calling the add_filter( … ) function built into WordPress. Calls the filter functions that will add our custom buttons.Checks that we are editing a post or page.Checks that the current user has permissions to edit posts and pages.

Next up we have what I call the main function for our custom TinyMCE plugin.
#Wordpress tinymce windowmanager free
I’m not sure why but I’ve always used really long slugs, but if you are making your own version of the plugin feel free to change that to whatever works for you (but make sure it’s unique!).

This can easily be done with the following code (all code in this tutorial will be taken directly from the example plugin):Īll code examples are taken directly from the example plugin!Īs you can see I use dobsondev_tinymce_example as the slug for my function titles. The CSS will be required when we want to use custom icons as well as dashicons for our menu items. The first call I want to make in my main plugin file is the call that hooks in our CSS file. The basic information for the plugin is as follows: Hooking in the CSS

Since I’ve called my plugin “DobsonDev WordPress TinyMCE Example” and I’ve named the folder dobsondev-wordpress-tinymce-example, I’ve opted to name my main file dobsondev-wordpress-tinymce-example.php.
#Wordpress tinymce windowmanager download
All the custom buttons will be added in a WordPress plugin and I will create an example plugin like the one’s I did for the Media Library and WordPress AJAX example plugins.Īlso for anyone who would rather just check out the example plugin instead of read through this article, you can download it from GitHub here. In a future tutorial I will go over adding some of the already existing buttons that are hidden by default in WordPress, but for this week I’ll concentrate on creating your own custom buttons.

Adding a TinyMCE button to your editor makes it easy for the user to add your shortcodes or buttons that generate custom styles beyond the default HTML tags like and. Creating your own custom TinyMCE buttons is a great feature that can add a lot of value to your WordPress plugin or theme.
