PluginProbe
Easy Bootstrap Shortcode / 3.7
Easy Bootstrap Shortcode v3.7
trunk 2.4.0 2.5 3.4 3.5 3.6 3.7 4.0.0 4.4 4.5 4.5.4 5.0.0 5.0.1 5.0.2
← All changes | shortcode/functions.php +12 -21 3.63.7 View file →
@@ -4,9 +4,12 @@
4 4 $elements = array(
5 5 'toggles',
6 6 'tabs',
7 7 'lists',
8 + 'deslist',
8 9 'buttons',
10 + 'btngrptool',
11 + 'btngrp',
9 12 'notifications',
10 13 'wpcolumns',
11 14 'tables',
12 15 'tooltip',
@@ -11,9 +14,9 @@
11 14 'tables',
12 15 'tooltip',
13 16 'iconhead',
14 17 'panel',
15 - 'popover',
18 + 'oscpopover',
16 19 'dropdown',
17 20 'labels',
18 21 'well',
19 22 'thumbnail',
@@ -18,9 +21,10 @@
18 21 'well',
19 22 'thumbnail',
20 23 'icon',
21 24 'image',
22 - 'progressbar'
25 + 'progressbar',
26 +
23 27 );
24 28
25 29 foreach ($elements as $element) {
26 30 include( $element . '/plugin_shortcode.php');
@@ -25,29 +29,21 @@
25 29 foreach ($elements as $element) {
26 30 include( $element . '/plugin_shortcode.php');
27 31 }
28 32
33 +add_action('init', 'osc_add_ebs_buttons_to_tinymce');
29 34
30 -// --------------------------------------------------------------------------------------------------------------
31 -
32 -add_action('init', 'add_custom_button');
33 -
34 -function add_custom_button() {
35 - //global $elements;
36 - // Don't bother doing this stuff if the current user lacks permissions
35 +function osc_add_ebs_buttons_to_tinymce() {
37 36 if (!current_user_can('edit_posts') && !current_user_can('edit_pages'))
38 37 return;
39 38
40 - // Add only in Rich Editor mode
41 39 if (get_user_option('rich_editing') == 'true') {
42 -
43 - add_filter("mce_external_plugins", "add_custom_plugin");
44 - add_filter('mce_buttons_3', 'register_custom_button');
40 + add_filter("mce_external_plugins", "osc_add_ebs_plugin");
41 + add_filter('mce_buttons_3', 'osc_register_ebs_button');
45 42 }
46 43 }
47 44
48 -function register_custom_button($buttons) {
49 -
45 +function osc_register_ebs_button($buttons) {
50 46 global $elements;
51 47 foreach ($elements as $element) {
52 48 $buttons[] = 'oscitas' . $element;
53 49 }
@@ -53,16 +49,11 @@
53 49 }
54 50 return $buttons;
55 51 }
56 52
57 -// Load the TinyMCE plugin : editor_plugin.js (wp2.5)
58 -function add_custom_plugin($plugin_array) {
59 - //print_r($elements); exit;
53 +function osc_add_ebs_plugin($plugin_array) {
60 54 global $elements;
61 55 foreach ($elements as $element) {
62 56 $plugin_array['oscitas' . $element] = plugins_url('', __FILE__) . '/' . $element . '/' . $element . '_plugin.js';
63 57 }
64 - /// return $buttons;
65 58 return $plugin_array;
66 59 }
67 -
68 -?>