File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 1717 */
1818
1919function tootpress_blogs_css () {
20+ // Load CSS only on Toots Page
2021 if ( tootpress_toot_here () ){
22+ // Load CSS only if Option is set
2123 if (get_option ('tootpress_css ' )) {
22- $ add_css = ' <link rel="stylesheet" id="mathilda-css" href=" ' . plugins_url () . ' /tootpress/ tootpress_toots.css" type="text/css" media="all"> ' ;
23- echo $ add_css ;
24+ wp_register_style ( ' tootpress ' , plugins_url ( ' tootpress_toots.css ' ) ) ;
25+ wp_enqueue_style ( ' tootpress ' ) ;
2426 }
2527 }
2628}
27-
28- add_action ('wp_head ' ,'tootpress_blogs_css ' );
29+ add_action ('wp_enqueue_scripts ' ,'tootpress_blogs_css ' );
2930
3031/**
3132 * Adds Admin CSS
3233 *
3334 * @since 0.1
3435 */
3536
36- function tootpress_admin_css () {
37- $ add_css ='<link rel="stylesheet" id="tootpress-css" href=" ' . plugins_url () .'/tootpress/tootpress_tools.css" type="text/css" media="all"> ' ;
38- echo $ add_css ;
37+ function tootpress_admin_css ($ hook ) {
38+ // Load CSS only on Toots Tools Page
39+ if ( 'tools_page_tootpress-tools-menu ' != $ hook ) {
40+ return ;
41+ }
42+ wp_register_style ( 'tootpress ' , plugins_url ( 'tootpress_tools.css ' ) );
43+ wp_enqueue_style ( 'tootpress ' );
3944}
40- add_action ( 'admin_head ' , 'tootpress_admin_css ' );
45+ add_action ( 'admin_enqueue_scripts ' , 'tootpress_admin_css ' );
4146
4247/**
4348 * Adds Mathilda Flag
You can’t perform that action at this time.
0 commit comments