| @@ -11,10 +11,8 @@ | ||
| 11 | 11 | protected $plugin_url; |
| 12 | 12 | protected $plugin_path; |
| 13 | 13 | protected $version; |
| 14 | 14 | |
| 15 | - protected $url; // pageURL | |
| 16 | - | |
| 17 | 15 | protected $networks; |
| 18 | 16 | protected $admin; |
| 19 | 17 | |
| 20 | 18 | public function __construct() |
| @@ -35,14 +33,11 @@ | ||
| 35 | 33 | |
| 36 | 34 | if (! is_admin()) |
| 37 | 35 | $hook_bool = collections::setupHooks(); |
| 38 | 36 | |
| 39 | - //add_action('admin_menu', array($this, 'admin_menu') ); | |
| 37 | + add_action('admin_menu', array($this, 'admin_menu') ); | |
| 40 | 38 | add_action('admin_enqueue_scripts', array($this, 'admin_styles') ); |
| 41 | 39 | |
| 42 | - // load admin pages, after MB. | |
| 43 | - add_filter('maxbuttons/plugin/admin_pages', array($this, 'admin_menu')); | |
| 44 | - | |
| 45 | 40 | add_action('add_meta_boxes', array($this, 'meta_boxes'), 10, 2 ); |
| 46 | 41 | add_action('save_post', array($this, 'save_meta_boxes'), 10, 3 ); |
| 47 | 42 | |
| 48 | 43 | add_action('wp_enqueue_scripts', array($this, 'front_scripts') ); |
| @@ -69,10 +64,8 @@ | ||
| 69 | 64 | remove_action('admin_init', array(maxUtils::namespaceit('maxAdmin'), 'do_review_notice')); |
| 70 | 65 | add_action('admin_init', array($this->admin(), 'do_review_notice')); |
| 71 | 66 | add_action('maxbuttons/ajax/mbsocial_review_notice_status', array($this->admin(), 'save_review_notice')); |
| 72 | 67 | |
| 73 | - add_action('wp_ajax_maxbuttons_social_css', array($this->admin()->namespaceit('collections'), 'outputFileCSS')); | |
| 74 | - add_action('wp_ajax_nopriv_maxbuttons_social_css', array($this->admin()->namespaceit('collections'), 'outputFileCSS')); | |
| 75 | 68 | //add_filter('mb-block-paths', array($this, 'block_templates')); |
| 76 | 69 | |
| 77 | 70 | } |
| 78 | 71 | |
| @@ -179,9 +172,9 @@ | ||
| 179 | 172 | |
| 180 | 173 | return $this->admin; |
| 181 | 174 | } |
| 182 | 175 | |
| 183 | - public function admin_menu ($admin_pages) | |
| 176 | + public function admin_menu () | |
| 184 | 177 | { |
| 185 | 178 | |
| 186 | 179 | $page_title = __('WordPress Share Buttons', 'mb-social'); |
| 187 | 180 | $menu_title = __('WordPress Share Buttons', 'mb-social'); |
| @@ -191,9 +184,9 @@ | ||
| 191 | 184 | $function = array($this, 'load_admin_page'); |
| 192 | 185 | $icon_url = $this->plugin_url . 'images/mb-social-icon.png'; |
| 193 | 186 | $submenu_function = array($this, 'load_admin_page'); |
| 194 | 187 | |
| 195 | - $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); | |
| 196 | 189 | |
| 197 | 190 | if (Install::isPro()) |
| 198 | 191 | { |
| 199 | 192 | $page_title = __('Settings', 'mb-social'); |
| @@ -198,12 +191,10 @@ | ||
| 198 | 191 | { |
| 199 | 192 | $page_title = __('Settings', 'mb-social'); |
| 200 | 193 | $submenu_slug = 'maxbuttons-social-settings'; |
| 201 | 194 | $function = array($this, 'load_settings_page'); |
| 202 | - $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); | |
| 203 | 196 | } |
| 204 | - | |
| 205 | - return $admin_pages; | |
| 206 | 197 | } |
| 207 | 198 | |
| 208 | 199 | public function admin_styles($hook) |
| 209 | 200 | { |
| @@ -219,13 +210,8 @@ | ||
| 219 | 210 | { |
| 220 | 211 | $deps = array('maxbuttons-pro-init','maxbuttons-ajax', 'mb-media-button', 'jquery-ui-sortable'); // pro init |
| 221 | 212 | wp_register_script('maxbuttons-mbcustom', $this->plugin_url . 'js/maxbuttons-custom.js', $deps, $this->version, true); |
| 222 | 213 | wp_enqueue_script('maxbuttons-mbcustom'); |
| 223 | - | |
| 224 | - wp_register_script('mbsocial-icons', $this->plugin_url . 'js/images.js', $deps, $this->version, true); | |
| 225 | - wp_enqueue_script('mbsocial-icons'); | |
| 226 | - | |
| 227 | - $deps[] = 'mbsocial-icons'; | |
| 228 | 214 | } |
| 229 | 215 | else |
| 230 | 216 | { |
| 231 | 217 | $deps = array('maxbutton-js-init', 'maxbuttons-ajax', 'mb-media-button', 'jquery-ui-sortable'); // free init |
| @@ -247,10 +233,8 @@ | ||
| 247 | 233 | { |
| 248 | 234 | wp_register_script('mbsocial_front', $this->plugin_url . 'js/social-front.js', array('jquery'), |
| 249 | 235 | $this->version, true); |
| 250 | 236 | |
| 251 | - wp_localize_script('mbsocial_front','mbsocial', array('ajaxurl' => admin_url( 'admin-ajax.php' ))); | |
| 252 | - | |
| 253 | 237 | wp_register_style('mbsocial-buttons', $this->plugin_url . 'css/buttons.css'); |
| 254 | 238 | |
| 255 | 239 | //wp_register_style('nucleo_icons', $this->plugin_url . 'libraries/nucleo_icons/nucleo_icons.css', array(), $this->version); |
| 256 | 240 | //wp_enqueue_style('nucleo_icons'); |
| @@ -287,13 +271,8 @@ | ||
| 287 | 271 | { |
| 288 | 272 | return trailingslashit(plugin_dir_url(MBSOCIAL_ROOT_FILE)); |
| 289 | 273 | } |
| 290 | 274 | |
| 291 | - public function get_page_url() | |
| 292 | - { | |
| 293 | - return $this->url; | |
| 294 | - } | |
| 295 | - | |
| 296 | 275 | public function get_version() |
| 297 | 276 | { |
| 298 | 277 | return MBSOCIAL_VERSION_NUM; |
| 299 | 278 | } |
| @@ -302,12 +281,9 @@ | ||
| 302 | 281 | { |
| 303 | 282 | if (Install::getIssue() == 'mb-wrong-version') |
| 304 | 283 | include_once($this->plugin_path . 'admin/update_mb.php'); |
| 305 | 284 | else |
| 306 | - { | |
| 307 | - $this->url = admin_url('?page=maxbuttons-social'); | |
| 308 | 285 | include_once($this->plugin_path . 'admin/page_editor.php'); |
| 309 | - } | |
| 310 | 286 | } |
| 311 | 287 | |
| 312 | 288 | public function load_settings_page() |
| 313 | 289 | { |
| @@ -313,11 +289,8 @@ | ||
| 313 | 289 | { |
| 314 | 290 | if (Install::getIssue() == 'mb-wrong-version') |
| 315 | 291 | include_once($this->plugin_path . 'admin/update_mb.php'); |
| 316 | 292 | else |
| 317 | - { | |
| 318 | - $this->url = admin_url('?page=maxbuttons-social-settings'); | |
| 319 | 293 | include_once($this->plugin_path . 'admin/page_settings.php'); |
| 320 | - } | |
| 321 | 294 | } |
| 322 | 295 | |
| 323 | 296 | } |