Changeset 3361437
- Timestamp:
- 09/15/2025 12:12:21 AM (7 months ago)
- Location:
- speedox
- Files:
-
- 2 edited
-
tags/1.1.2/speedox.php (modified) (4 diffs)
-
trunk/speedox.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
speedox/tags/1.1.2/speedox.php
r3361433 r3361437 24 24 SpeedOx_Logger::init(); 25 25 26 // version constant — keep in sync with plugin header 27 if (!defined('SPEEDOX_VERSION')) { 28 define('SPEEDOX_VERSION', '1.1.3'); 29 } 30 26 define('SPEEDOX_VERSION', '1.1.4'); // update on each release 31 27 define('SPEEDOX_PLUGIN_DIR', plugin_dir_path(__FILE__)); 32 28 define('SPEEDOX_PLUGIN_URL', plugin_dir_url(__FILE__)); … … 40 36 require_once SPEEDOX_PLUGIN_DIR . 'includes/admin-bar.php'; 41 37 42 // Enqueue admin styles and scripts (robust detection) 43 add_action('admin_enqueue_scripts', 'speedox_enqueue_admin_assets'); 44 function speedox_enqueue_admin_assets($hook) { 45 // Be flexible: check if the current admin page relates to SpeedOx 46 if (false === strpos($hook, 'speedox')) { 47 return; 48 } 49 50 // Ensure WP icons are available 51 wp_enqueue_style('dashicons'); 52 53 // Plugin admin CSS/JS — use plugin_dir_url to ensure correct path after WP.org installs 38 // Enqueue admin styles and scripts 39 add_action('admin_enqueue_scripts', 'speedox_admin_enqueue'); 40 function speedox_admin_enqueue($hook) { 41 if (strpos($hook, 'speedox') !== false) { 42 wp_enqueue_style( 43 'speedox-admin', 44 plugin_dir_url(__FILE__) . 'assets/css/admin.css', 45 array(), 46 SPEEDOX_VERSION 47 ); 48 wp_enqueue_script( 49 'speedox-admin', 50 plugin_dir_url(__FILE__) . 'assets/js/admin.js', 51 array('jquery'), 52 SPEEDOX_VERSION, 53 true 54 ); 55 wp_enqueue_style('dashicons'); 56 } 57 } 58 59 // Custom emoji icon for admin menu using enqueued CSS file 60 add_action('admin_enqueue_scripts', 'speedox_custom_menu_icon_style'); 61 function speedox_custom_menu_icon_style() { 54 62 wp_enqueue_style( 55 'speedox-admin- css',56 plugin_dir_url(__FILE__) . 'assets/css/admin .css',63 'speedox-admin-menu-icon', 64 plugin_dir_url(__FILE__) . 'assets/css/admin-menu-icon.css', 57 65 array(), 58 66 SPEEDOX_VERSION 59 67 ); 60 61 wp_enqueue_script( 62 'speedox-admin-js', 63 plugin_dir_url(__FILE__) . 'assets/js/admin.js', 64 array('jquery'), 65 SPEEDOX_VERSION, 66 true 67 ); 68 } 69 70 // NOTE: We use inline CSS for the custom menu icon below — avoid enqueuing a separate admin-menu-icon.css 68 } 69 71 70 // Activation: schedule cache-clearing event if not already scheduled 72 71 register_activation_hook(__FILE__, 'speedox_activate'); … … 99 98 function speedox_add_admin_menu() { 100 99 add_menu_page( 101 'SpeedOx Dashboard',102 'SpeedOx',103 'manage_options',104 'speedox-dashboard',105 'speedox_admin_dashboard_page',106 '', // We'll style the icon via inlineCSS107 30108 );100 'SpeedOx Dashboard', 101 'SpeedOx', 102 'manage_options', 103 'speedox-dashboard', 104 'speedox_admin_dashboard_page', 105 '', // Don't use dashicons, allow custom CSS 106 30 107 ); 109 108 } 110 109 … … 264 263 } 265 264 266 // ✅ Add custom emoji icon (⚡) to admin menu via inline CSS265 // ✅ Add custom emoji icon (⚡) to admin menu 267 266 add_action('admin_head', 'speedox_custom_menu_icon_inline_css'); 268 267 function speedox_custom_menu_icon_inline_css() { -
speedox/trunk/speedox.php
r3361433 r3361437 24 24 SpeedOx_Logger::init(); 25 25 26 // version constant — keep in sync with plugin header 27 if (!defined('SPEEDOX_VERSION')) { 28 define('SPEEDOX_VERSION', '1.1.3'); 29 } 30 26 define('SPEEDOX_VERSION', '1.1.4'); // update on each release 31 27 define('SPEEDOX_PLUGIN_DIR', plugin_dir_path(__FILE__)); 32 28 define('SPEEDOX_PLUGIN_URL', plugin_dir_url(__FILE__)); … … 40 36 require_once SPEEDOX_PLUGIN_DIR . 'includes/admin-bar.php'; 41 37 42 // Enqueue admin styles and scripts (robust detection) 43 add_action('admin_enqueue_scripts', 'speedox_enqueue_admin_assets'); 44 function speedox_enqueue_admin_assets($hook) { 45 // Be flexible: check if the current admin page relates to SpeedOx 46 if (false === strpos($hook, 'speedox')) { 47 return; 48 } 49 50 // Ensure WP icons are available 51 wp_enqueue_style('dashicons'); 52 53 // Plugin admin CSS/JS — use plugin_dir_url to ensure correct path after WP.org installs 38 // Enqueue admin styles and scripts 39 add_action('admin_enqueue_scripts', 'speedox_admin_enqueue'); 40 function speedox_admin_enqueue($hook) { 41 if (strpos($hook, 'speedox') !== false) { 42 wp_enqueue_style( 43 'speedox-admin', 44 plugin_dir_url(__FILE__) . 'assets/css/admin.css', 45 array(), 46 SPEEDOX_VERSION 47 ); 48 wp_enqueue_script( 49 'speedox-admin', 50 plugin_dir_url(__FILE__) . 'assets/js/admin.js', 51 array('jquery'), 52 SPEEDOX_VERSION, 53 true 54 ); 55 wp_enqueue_style('dashicons'); 56 } 57 } 58 59 // Custom emoji icon for admin menu using enqueued CSS file 60 add_action('admin_enqueue_scripts', 'speedox_custom_menu_icon_style'); 61 function speedox_custom_menu_icon_style() { 54 62 wp_enqueue_style( 55 'speedox-admin- css',56 plugin_dir_url(__FILE__) . 'assets/css/admin .css',63 'speedox-admin-menu-icon', 64 plugin_dir_url(__FILE__) . 'assets/css/admin-menu-icon.css', 57 65 array(), 58 66 SPEEDOX_VERSION 59 67 ); 60 61 wp_enqueue_script( 62 'speedox-admin-js', 63 plugin_dir_url(__FILE__) . 'assets/js/admin.js', 64 array('jquery'), 65 SPEEDOX_VERSION, 66 true 67 ); 68 } 69 70 // NOTE: We use inline CSS for the custom menu icon below — avoid enqueuing a separate admin-menu-icon.css 68 } 69 71 70 // Activation: schedule cache-clearing event if not already scheduled 72 71 register_activation_hook(__FILE__, 'speedox_activate'); … … 99 98 function speedox_add_admin_menu() { 100 99 add_menu_page( 101 'SpeedOx Dashboard',102 'SpeedOx',103 'manage_options',104 'speedox-dashboard',105 'speedox_admin_dashboard_page',106 '', // We'll style the icon via inlineCSS107 30108 );100 'SpeedOx Dashboard', 101 'SpeedOx', 102 'manage_options', 103 'speedox-dashboard', 104 'speedox_admin_dashboard_page', 105 '', // Don't use dashicons, allow custom CSS 106 30 107 ); 109 108 } 110 109 … … 264 263 } 265 264 266 // ✅ Add custom emoji icon (⚡) to admin menu via inline CSS265 // ✅ Add custom emoji icon (⚡) to admin menu 267 266 add_action('admin_head', 'speedox_custom_menu_icon_inline_css'); 268 267 function speedox_custom_menu_icon_inline_css() {
Note: See TracChangeset
for help on using the changeset viewer.