WordPress.org

Make WordPress Core

Ticket #19898: 19898.2.diff

File 19898.2.diff, 745 bytes (added by scribu, 2 years ago)
  • wp-includes/load.php

    diff --git wp-includes/load.php wp-includes/load.php
    index 1742af4..0b42ac3 100644
    function wp_clone( $object ) { 
    573573} 
    574574 
    575575/** 
     576 * Whether the current request is for a login page 
     577 * 
     578 * @since 3.5.0 
     579 * 
     580 * @return bool 
     581 */ 
     582function is_login() { 
     583        $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 
     584 
     585        $current_url = remove_query_arg( array( 'redirect_to', 'loggedout', 'action' ), $current_url ); 
     586 
     587        $login_url = wp_login_url(); 
     588 
     589        return $login_url == $current_url; 
     590} 
     591 
     592/** 
    576593 * Whether the current request is for a network or blog admin page 
    577594 * 
    578595 * Does not inform on whether the user is an admin! Use capability checks to