PluginProbe
Contact Forms by Cimatti / 1.9.2
Contact Forms by Cimatti v1.9.2
2.3.6 2.3.5 2.3.0 2.2.32 2.2.4 2.2.0 2.1.2 2.1.1 trunk 1.0 1.1 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 All 62 releases
contact-forms / accua-shortcode-button.php

accua-shortcode-button.php in Contact Forms by Cimatti 1.9.2, at accua-shortcode-button.php

37 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // registers the buttons for use
3 function register_accua_fancy_buttons($buttons) {
4 // inserts a separator between existing buttons and our new one
5 // "accua_fancy_button" is the ID of our button
6 array_push($buttons, "|", "accua_fancy_button");
7 return $buttons;
8 }
9
10 // filters the tinyMCE buttons and adds our custom buttons
11 function accua_shortcode_buttons() {
12 // Don't bother doing this stuff if the current user lacks permissions
13 if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
14 return;
15
16 // Add only in Rich Editor mode
17 if ( get_user_option('rich_editing') == 'true') {
18 // filter the tinyMCE buttons and add our own
19 add_filter("mce_external_plugins", "add_accua_tinymce_plugin");
20 add_filter('mce_buttons', 'register_accua_fancy_buttons');
21 }
22 }
23 // init process for button control
24 add_action('init', 'accua_shortcode_buttons');
25
26 // add the button to the tinyMCE bar
27 function add_accua_tinymce_plugin($plugin_array) {
28 $plugin_array['accua_fancy_button'] = plugins_url('accua-shortcode-button.js?v='.ACCUA_FORMS_JS_VERSION, ACCUA_FORMS_FILE);
29 return $plugin_array;
30 }
31
32 add_action('wp_ajax_accua_shortcode_button_popup', 'accua_shortcode_buttons_popup');
33 function accua_shortcode_buttons_popup() {
34 require_once('accua-shortcode-button-popup.php');
35 die('');
36 }
37