Changeset 3201828
- Timestamp:
- 12/03/2024 04:20:27 PM (15 months ago)
- Location:
- schema-markup-customizer
- Files:
-
- 2 edited
-
tags/1.0.5/schema-markup-customizer.php (modified) (1 diff)
-
trunk/schema-markup-customizer.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
schema-markup-customizer/tags/1.0.5/schema-markup-customizer.php
r3201819 r3201828 197 197 add_action('admin_notices', 'dyxperts_add_deactivation_notice'); 198 198 199 200 function dyxperts_bootstrap_backend() { 199 function dyxperts_bootstrap_backend() { 200 // Check if we are in the admin area and on the settings page 201 201 if (is_admin() && isset($_GET['page']) && $_GET['page'] == 'schema_markup_settings') { 202 202 203 $css_admin = MY_CSS_URL . 'assets/css/admin-style.css'; 204 $version_admin = filemtime( plugin_dir_path( __FILE__ ) . 'assets/css/admin-style.css' ); // Corrected path 205 wp_enqueue_style( 'msb-admin-style', $css_admin, array(), $version_admin ); 206 207 } 208 } 209 add_action( 'admin_enqueue_scripts', 'dyxperts_bootstrap_backend' ); 203 // Correct URL for the CSS file 204 $css_admin = plugins_url('assets/css/admin-style.css', __FILE__); 205 206 // Correct path for the file to get its modification time 207 $css_file_path = plugin_dir_path(__FILE__) . 'assets/css/admin-style.css'; 208 209 // Ensure filemtime() is only called if the file exists 210 if (file_exists($css_file_path)) { 211 $version_admin = filemtime($css_file_path); // Get the file's last modified time 212 } else { 213 $version_admin = time(); // Use current time if the file doesn't exist 214 } 215 216 // Enqueue the style with versioning 217 wp_enqueue_style('msb-admin-style', $css_admin, array(), $version_admin); 218 } 219 } 220 add_action('admin_enqueue_scripts', 'dyxperts_bootstrap_backend'); -
schema-markup-customizer/trunk/schema-markup-customizer.php
r3201819 r3201828 197 197 add_action('admin_notices', 'dyxperts_add_deactivation_notice'); 198 198 199 200 function dyxperts_bootstrap_backend() { 199 function dyxperts_bootstrap_backend() { 200 // Check if we are in the admin area and on the settings page 201 201 if (is_admin() && isset($_GET['page']) && $_GET['page'] == 'schema_markup_settings') { 202 202 203 $css_admin = MY_CSS_URL . 'assets/css/admin-style.css'; 204 $version_admin = filemtime( plugin_dir_path( __FILE__ ) . 'assets/css/admin-style.css' ); // Corrected path 205 wp_enqueue_style( 'msb-admin-style', $css_admin, array(), $version_admin ); 206 207 } 208 } 209 add_action( 'admin_enqueue_scripts', 'dyxperts_bootstrap_backend' ); 203 // Correct URL for the CSS file 204 $css_admin = plugins_url('assets/css/admin-style.css', __FILE__); 205 206 // Correct path for the file to get its modification time 207 $css_file_path = plugin_dir_path(__FILE__) . 'assets/css/admin-style.css'; 208 209 // Ensure filemtime() is only called if the file exists 210 if (file_exists($css_file_path)) { 211 $version_admin = filemtime($css_file_path); // Get the file's last modified time 212 } else { 213 $version_admin = time(); // Use current time if the file doesn't exist 214 } 215 216 // Enqueue the style with versioning 217 wp_enqueue_style('msb-admin-style', $css_admin, array(), $version_admin); 218 } 219 } 220 add_action('admin_enqueue_scripts', 'dyxperts_bootstrap_backend');
Note: See TracChangeset
for help on using the changeset viewer.