Created
April 28, 2023 14:52
-
-
Save aslamatwebdevstudios/e5f0253868e5bb7dca55d66a71bdc525 to your computer and use it in GitHub Desktop.
Enqueue Admin Styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_plugin_enqueue($hook) { | |
if ( 'edit.php' === $hook ) { | |
$file_path = plugin_dir_path( __FILE__ ) . 'css/edit_page_styles.css'; | |
$version = filemtime( $file_path ); | |
wp_register_style( | |
'my_plugin_main_css', | |
plugins_url( '/css/edit_page_styles.css', __FILE__ ), | |
array(), | |
$version | |
); | |
wp_enqueue_style( 'my_plugin_main_css' ); | |
} | |
} | |
add_action( 'admin_enqueue_scripts', 'my_plugin_enqueue' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment