PluginProbe
Easy Bootstrap Shortcode / 2.5
Easy Bootstrap Shortcode v2.5
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
easy-bootstrap-shortcodes / shortcode / functions.php

functions.php in Easy Bootstrap Shortcode 2.5, at shortcode/functions.php

83 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Add Shortcode buttons in TinyMCE
4 $css = get_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 );
5 if($css==3){
6 define('EBS_CONTAINER_CLASS',' oscitas-bootstrap-container');
7 define('EBS_POPOVER_TEMPLATE','<div class="popover'.EBS_CONTAINER_CLASS.'"><div class="arrow'.EBS_CONTAINER_CLASS.'"></div><h3 class="popover-title'.EBS_CONTAINER_CLASS.'"></h3><div class="popover-content'.EBS_CONTAINER_CLASS.' "></div></div>');
8 define('EBS_TOOLTIP_TEMPLATE','<div class="tooltip'.EBS_CONTAINER_CLASS.'"><div class="tooltip-arrow'.EBS_CONTAINER_CLASS.'"></div><div class="tooltip-inner'.EBS_CONTAINER_CLASS.'"></div></div>');
9 } else{
10 define('EBS_CONTAINER_CLASS','');
11 define('EBS_POPOVER_TEMPLATE','');
12 define('EBS_TOOLTIP_TEMPLATE','');
13 }
14 $elements = array(
15 'toggles',
16 'tabs',
17 'lists',
18 'deslist',
19 'buttons',
20 'btngrptool',
21 'btngrp',
22 'notifications',
23 'wpcolumns',
24 'tables',
25 'tooltip',
26 'iconhead',
27 'panel',
28 'oscpopover',
29 'dropdown',
30 'labels',
31 'well',
32 'thumbnail',
33 'icon',
34 'image',
35 'progressbar',
36 'servicebox',
37 'slider'
38
39 );
40
41 foreach ($elements as $element) {
42 include( $element . '/plugin_shortcode.php');
43 }
44
45 add_action('init', 'osc_add_ebs_buttons_to_tinymce');
46
47 function osc_add_ebs_buttons_to_tinymce() {
48 $ebsp_editor_opt=get_option('EBS_EDITOR_OPT','icon');
49 if (!current_user_can('edit_posts') && !current_user_can('edit_pages'))
50 return;
51
52 if (get_user_option('rich_editing') == 'true') {
53 add_filter("mce_external_plugins", "osc_add_ebs_plugin");
54 if($ebsp_editor_opt=='icon'){
55 add_filter('mce_buttons_3', 'osc_register_ebs_button');
56 } else{
57 add_filter('mce_buttons', 'osc_register_ebs_dropdown');
58 }
59 }
60 }
61 function osc_register_ebs_dropdown($buttons){
62 $buttons[] = 'oscitas_main_dropdown_button';
63 return $buttons;
64 }
65 function osc_register_ebs_button($buttons) {
66 global $elements;
67 foreach ($elements as $element) {
68 $buttons[] = 'oscitas' . $element;
69 }
70 return $buttons;
71 }
72
73 function osc_add_ebs_plugin($plugin_array) {
74 global $elements;
75 foreach ($elements as $element) {
76 $plugin_array['oscitas' . $element] = plugins_url('', __FILE__) . '/' . $element . '/' . $element . '_plugin.js';
77 }
78 $plugin_array['oscitas_main_dropdown']=EBS_PLUGIN_URL.'js/oscitas_main_dropdown.js';
79 return $plugin_array;
80 return $plugin_array;
81 }
82
83