wp_auth_check_html

Output the HTML that shows the wp-login dialog when the user is no longer logged in.

Description

wp_auth_check_html(); 

Usage

  1. if ( !function_exists( 'wp_auth_check_html' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_auth_check_html(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function wp_auth_check_html() { 
  2. $login_url = wp_login_url(); 
  3. $current_domain = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST']; 
  4. $same_domain = ( strpos( $login_url, $current_domain ) === 0 ); 
  5.  
  6. /** 
  7. * Filters whether the authentication check originated at the same domain. 
  8. * @since 3.6.0 
  9. * @param bool $same_domain Whether the authentication check originated at the same domain. 
  10. */ 
  11. $same_domain = apply_filters( 'wp_auth_check_same_domain', $same_domain ); 
  12. $wrap_class = $same_domain ? 'hidden' : 'hidden fallback'; 
  13.  
  14. ?> 
  15. <div id="wp-auth-check-wrap" class="<?php echo $wrap_class; ?>"> 
  16. <div id="wp-auth-check-bg"></div> 
  17. <div id="wp-auth-check"> 
  18. <button type="button" class="wp-auth-check-close button-link"><span class="screen-reader-text"><?php _e( 'Close dialog' ); ?></span></button> 
  19. <?php 
  20.  
  21. if ( $same_domain ) { 
  22. ?> 
  23. <div id="wp-auth-check-form" class="loading" data-src="<?php echo esc_url( add_query_arg( array( 'interim-login' => 1 ), $login_url ) ); ?>"></div> 
  24. <?php 
  25.  
  26. ?> 
  27. <div class="wp-auth-fallback"> 
  28. <p><b class="wp-auth-fallback-expired" tabindex="0"><?php _e('Session expired'); ?></b></p> 
  29. <p><a href="<?php echo esc_url( $login_url ); ?>" target="_blank"><?php _e('Please log in again.'); ?></a> 
  30. <?php _e('The login page will open in a new window. After logging in you can close it and return to this page.'); ?></p> 
  31. </div> 
  32. </div> 
  33. </div> 
  34. <?php