Ticket #4478: wp-login.php.diff
File wp-login.php.diff, 4.1 KB (added by , 14 years ago) |
---|
-
wp-login.php
old new 1 1 <?php 2 2 require( dirname(__FILE__) . '/wp-config.php' ); 3 3 4 /* support for custom error page by user kevinobvious -- http://wordpress.org/support/topic/109477 */ 5 if (function_exists('get_template_directory')){ 6 $templatedir = get_template_directory(); 7 if ( file_exists($templatedir.'/login.php') ){ 8 include($templatedir.'/login.php'); 9 } 10 } 4 11 // Rather than duplicating this HTML all over the place, we'll stick it in function 5 function login_header ($title = 'Login',$message = '', $wp_error = '') {12 function login_header_error($message = '', $wp_error = '') { 6 13 global $error; 7 14 8 15 if ( empty($wp_error) ) 9 16 $wp_error = new WP_Error(); 10 ?>11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">12 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>13 <head>14 <title><?php bloginfo('name'); ?> › <?php echo $title; ?></title>15 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />16 <?php17 wp_admin_css( 'css/login' );18 wp_admin_css( 'css/colors-fresh' );19 ?>20 <script type="text/javascript">21 function focusit() {22 document.getElementById('user_login').focus();23 }24 window.onload = focusit;25 </script>26 <?php do_action('login_head'); ?>27 </head>28 <body class="login">29 17 30 <div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_headertitle', __('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1>31 <?php32 18 if ( !empty( $message ) ) echo apply_filters('login_message', $message) . "\n"; 33 19 34 20 // Incase a plugin uses $error rather than the $errors object … … 54 40 if ( !empty($messages) ) 55 41 echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n"; 56 42 } 43 } 44 45 if (!function_exists('login_header')) { 46 function login_header($title = 'Login', $message = '', $wp_error = '') { 47 48 ?> 49 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 50 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> 51 <head> 52 <title><?php bloginfo('name'); ?> › <?php echo $title; ?></title> 53 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> 54 <?php 55 wp_admin_css( 'css/login' ); 56 wp_admin_css( 'css/colors-fresh' ); 57 ?> 58 <script type="text/javascript"> 59 function focusit() { 60 document.getElementById('user_login').focus(); 61 } 62 window.onload = focusit; 63 </script> 64 <?php do_action('login_head'); ?> 65 </head> 66 <body class="login"> 67 68 <div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_headertitle', __('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1> 69 <?php 70 login_header_error($message, $wp_error); 57 71 } // End of login_header() 72 } 73 if (!function_exists('login_footer')) { 74 function login_footer() { 75 echo "\n</body>\n</html>"; 76 } 77 } // End of login_footer() 58 78 59 79 function retrieve_password() { 60 80 global $wpdb; … … 269 289 270 290 <p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('« Back to %s'), get_bloginfo('title', 'display' )); ?></a></p> 271 291 272 </body>273 </html>274 292 <?php 293 login_footer(); 275 294 break; 276 295 277 296 case 'resetpass' : … … 333 352 </div> 334 353 335 354 <p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('« Back to %s'), get_bloginfo('title', 'display' )); ?></a></p> 336 337 </body>338 </html>339 355 <?php 356 login_footer(); 340 357 break; 341 358 342 359 case 'login' : … … 410 427 </div> 411 428 412 429 <p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('« Back to %s'), get_bloginfo('title', 'display' )); ?></a></p> 413 414 </body>415 </html>416 430 <?php 417 431 login_footer(); 418 432 break; 419 433 } // end action switch 420 434 ?>