Просмотр исходного кода

Merge pull request #306 from thatryan/master

Updated custom login CSS function to use wp_enqueue_style
Eddie Machado 13 лет назад
Родитель
Сommit
e36915721e
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      library/admin.php

+ 5 - 3
library/admin.php

@@ -92,9 +92,11 @@ add_action('wp_dashboard_setup', 'bones_custom_dashboard_widgets');
 /************* CUSTOM LOGIN PAGE *****************/
 
 // calling your own login css so you can style it
+
+//Updated to proper 'enqueue' method
+//http://codex.wordpress.org/Plugin_API/Action_Reference/login_enqueue_scripts
 function bones_login_css() {
-	/* I couldn't get wp_enqueue_style to work :( */
-	echo '<link rel="stylesheet" href="' . get_stylesheet_directory_uri() . '/library/css/login.css">';
+	wp_enqueue_style( 'bones_login_css', get_template_directory_uri() . '/library/css/login.css', false );
 }
 
 // changing the logo link from wordpress.org to your site
@@ -104,7 +106,7 @@ function bones_login_url() {  return home_url(); }
 function bones_login_title() { return get_option('blogname'); }
 
 // calling it only on the login page
-add_action('login_head', 'bones_login_css');
+add_action( 'login_enqueue_scripts', 'bones_login_css', 10 );
 add_filter('login_headerurl', 'bones_login_url');
 add_filter('login_headertitle', 'bones_login_title');