| @@ -33,14 +33,11 @@ | ||
| 33 | 33 | |
| 34 | 34 | if (! is_admin()) |
| 35 | 35 | $hook_bool = collections::setupHooks(); |
| 36 | 36 | |
| 37 | - //add_action('admin_menu', array($this, 'admin_menu') ); | |
| 37 | + add_action('admin_menu', array($this, 'admin_menu') ); | |
| 38 | 38 | add_action('admin_enqueue_scripts', array($this, 'admin_styles') ); |
| 39 | 39 | |
| 40 | - // load admin pages, after MB. | |
| 41 | - add_filter('maxbuttons/plugin/admin_pages', array($this, 'admin_menu')); | |
| 42 | - | |
| 43 | 40 | add_action('add_meta_boxes', array($this, 'meta_boxes'), 10, 2 ); |
| 44 | 41 | add_action('save_post', array($this, 'save_meta_boxes'), 10, 3 ); |
| 45 | 42 | |
| 46 | 43 | add_action('wp_enqueue_scripts', array($this, 'front_scripts') ); |
| @@ -67,10 +64,8 @@ | ||
| 67 | 64 | remove_action('admin_init', array(maxUtils::namespaceit('maxAdmin'), 'do_review_notice')); |
| 68 | 65 | add_action('admin_init', array($this->admin(), 'do_review_notice')); |
| 69 | 66 | add_action('maxbuttons/ajax/mbsocial_review_notice_status', array($this->admin(), 'save_review_notice')); |
| 70 | 67 | |
| 71 | - add_action('wp_ajax_maxbuttons_social_css', array($this->admin()->namespaceit('collections'), 'outputFileCSS')); | |
| 72 | - add_action('wp_ajax_nopriv_maxbuttons_social_css', array($this->admin()->namespaceit('collections'), 'outputFileCSS')); | |
| 73 | 68 | //add_filter('mb-block-paths', array($this, 'block_templates')); |
| 74 | 69 | |
| 75 | 70 | } |
| 76 | 71 | |
| @@ -177,9 +172,9 @@ | ||
| 177 | 172 | |
| 178 | 173 | return $this->admin; |
| 179 | 174 | } |
| 180 | 175 | |
| 181 | - public function admin_menu ($admin_pages) | |
| 176 | + public function admin_menu () | |
| 182 | 177 | { |
| 183 | 178 | |
| 184 | 179 | $page_title = __('WordPress Share Buttons', 'mb-social'); |
| 185 | 180 | $menu_title = __('WordPress Share Buttons', 'mb-social'); |
| @@ -189,9 +184,9 @@ | ||
| 189 | 184 | $function = array($this, 'load_admin_page'); |
| 190 | 185 | $icon_url = $this->plugin_url . 'images/mb-social-icon.png'; |
| 191 | 186 | $submenu_function = array($this, 'load_admin_page'); |
| 192 | 187 | |
| 193 | - $admin_pages[] = add_menu_page($page_title, $menu_title, $admin_capability, $menu_slug, $function, $icon_url, 82); | |
| 188 | + add_menu_page($page_title, $menu_title, $admin_capability, $menu_slug, $function, $icon_url, 82); | |
| 194 | 189 | |
| 195 | 190 | if (Install::isPro()) |
| 196 | 191 | { |
| 197 | 192 | $page_title = __('Settings', 'mb-social'); |
| @@ -196,12 +191,10 @@ | ||
| 196 | 191 | { |
| 197 | 192 | $page_title = __('Settings', 'mb-social'); |
| 198 | 193 | $submenu_slug = 'maxbuttons-social-settings'; |
| 199 | 194 | $function = array($this, 'load_settings_page'); |
| 200 | - $admin_pages[] = add_submenu_page($menu_slug, $page_title, $page_title, $admin_capability, $submenu_slug, $function); | |
| 195 | + add_submenu_page($menu_slug, $page_title, $page_title, $admin_capability, $submenu_slug, $function); | |
| 201 | 196 | } |
| 202 | - | |
| 203 | - return $admin_pages; | |
| 204 | 197 | } |
| 205 | 198 | |
| 206 | 199 | public function admin_styles($hook) |
| 207 | 200 | { |
| @@ -217,13 +210,8 @@ | ||
| 217 | 210 | { |
| 218 | 211 | $deps = array('maxbuttons-pro-init','maxbuttons-ajax', 'mb-media-button', 'jquery-ui-sortable'); // pro init |
| 219 | 212 | wp_register_script('maxbuttons-mbcustom', $this->plugin_url . 'js/maxbuttons-custom.js', $deps, $this->version, true); |
| 220 | 213 | wp_enqueue_script('maxbuttons-mbcustom'); |
| 221 | - | |
| 222 | - wp_register_script('mbsocial-icons', $this->plugin_url . 'js/images.js', $deps, $this->version, true); | |
| 223 | - wp_enqueue_script('mbsocial-icons'); | |
| 224 | - | |
| 225 | - $deps[] = 'mbsocial-icons'; | |
| 226 | 214 | } |
| 227 | 215 | else |
| 228 | 216 | { |
| 229 | 217 | $deps = array('maxbutton-js-init', 'maxbuttons-ajax', 'mb-media-button', 'jquery-ui-sortable'); // free init |
| @@ -244,10 +232,8 @@ | ||
| 244 | 232 | public function front_scripts($hook) |
| 245 | 233 | { |
| 246 | 234 | wp_register_script('mbsocial_front', $this->plugin_url . 'js/social-front.js', array('jquery'), |
| 247 | 235 | $this->version, true); |
| 248 | - | |
| 249 | - wp_localize_script('mbsocial_front','mbsocial', array('ajaxurl' => admin_url( 'admin-ajax.php' ))); | |
| 250 | 236 | |
| 251 | 237 | wp_register_style('mbsocial-buttons', $this->plugin_url . 'css/buttons.css'); |
| 252 | 238 | |
| 253 | 239 | //wp_register_style('nucleo_icons', $this->plugin_url . 'libraries/nucleo_icons/nucleo_icons.css', array(), $this->version); |