Changeset 1476083
- Timestamp:
- 08/16/2016 10:27:14 PM (10 years ago)
- Location:
- cm-css-columns/trunk
- Files:
-
- 3 added
- 3 edited
-
admin/Admin.php (modified) (1 diff)
-
admin/assets (added)
-
admin/assets/icon.png (added)
-
admin/js/admin.js (modified) (1 diff)
-
admin/js/tinymce-cm-css-columns.js (added)
-
includes/CorePlugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cm-css-columns/trunk/admin/Admin.php
r1475941 r1476083 109 109 */ 110 110 wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/admin.js', array('jquery'), $this->version, false); 111 } 112 /** 113 * 114 * @param array $plugin_array 115 * @return array 116 */ 117 public function enqueue_mce_plugin_scripts($plugin_array) { 118 $plugin_array['cm_css_columns'] = plugin_dir_url(__FILE__) . 'js/tinymce-cm-css-columns.js'; 119 return $plugin_array; 120 } 121 122 public function register_mce_buttons($buttons) { 123 array_push($buttons, 'separator', 'cm_css_columns'); 124 return $buttons; 111 125 } 112 126 -
cm-css-columns/trunk/admin/js/admin.js
r1475941 r1476083 1 (function ($) {2 /**3 * All of the code for your admin-facing JavaScript source4 * should reside in this file.5 *6 * Note: It has been assumed you will write jQuery code here, so the7 * $ function reference has been prepared for usage within the scope8 * of this function.9 *10 * This enables you to define handlers, for when the DOM is ready:11 *12 * $(function() {13 *14 * });15 *16 * When the window is loaded:17 *18 * $( window ).load(function() {19 *20 * });21 *22 * ...and/or other possibilities.23 *24 * Ideally, it is not considered best practise to attach more than a25 * single DOM-ready or window-load handler for a particular page.26 * Although scripts in the WordPress core, Plugins and Themes may be27 * practising this, we should strive to set a better example in our own work.28 */29 })(jQuery); -
cm-css-columns/trunk/includes/CorePlugin.php
r1475941 r1476083 95 95 $this->set_locale(); 96 96 $this->define_admin_hooks(); 97 $this->define_admin_filter(); 97 98 $this->define_public_hooks(); 98 99 } … … 152 153 153 154 private function define_admin_filter() { 155 // Check if the logged in WordPress User can edit Posts or Pages 156 // If not, don't register our TinyMCE plugin 157 /*if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) { 158 return; 159 }*/ 160 161 // Check if the logged in WordPress User has the Visual Editor enabled 162 // If not, don't register our TinyMCE plugin 163 /*if (get_user_option('rich_editing') !== 'true') { 164 return; 165 }*/ 166 167 $this->loader->add_filter('mce_external_plugins', $this->plugin_admin, 'enqueue_mce_plugin_scripts',10,1); 168 $this->loader->add_filter('mce_buttons', $this->plugin_admin, 'register_mce_buttons',10,1); 154 169 } 155 170
Note: See TracChangeset
for help on using the changeset viewer.