mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-01 21:21:24 +01:00
is_user_logged_in()
git-svn-id: http://svn.automattic.com/wordpress/trunk@3309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9aa7dc5290
commit
5a56fc2414
@ -4,7 +4,7 @@ require_once('admin-functions.php');
|
||||
require_once('admin-db.php');
|
||||
|
||||
get_currentuserinfo();
|
||||
if ( !$current_user )
|
||||
if ( !is_user_logged_in() )
|
||||
die('-1');
|
||||
|
||||
function grab_results() {
|
||||
|
@ -1563,7 +1563,7 @@ class WP {
|
||||
function send_headers() {
|
||||
global $current_user;
|
||||
@header('X-Pingback: '. get_bloginfo('pingback_url'));
|
||||
if ( $current_user )
|
||||
if ( is_user_logged_in() )
|
||||
nocache_headers();
|
||||
if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) {
|
||||
status_header( 404 );
|
||||
|
@ -152,6 +152,16 @@ function wp_login($username, $password, $already_md5 = false) {
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( !function_exists('is_user_logged_in') ) :
|
||||
function is_user_logged_in() {
|
||||
global $current_user;
|
||||
|
||||
if ( $current_user->id == 0 )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( !function_exists('auth_redirect') ) :
|
||||
function auth_redirect() {
|
||||
// Checks if a user is logged in, if not redirects them to the login page
|
||||
|
Loading…
Reference in New Issue
Block a user