WP shows a error msg: undefined the is_user_logged_in().
something is wrong?
WP shows a error msg: undefined the is_user_logged_in().
something is wrong?
to use the function of is_home() that it works.
the is_user_logged_in doesn't work, why?
now i write the is_user_logged_in() in the function,it works.but the outside.
hope you've read this:
http://codex.wordpress.org/Function_Reference/is_user_logged_in
yes.i had read. but nothing found...
What do you mean by plugin page? functions.php?
plugin page means the my-plugin-name.php.
for example:
my-plugin-name.php:
<?php
/*
Plugin Name: my plugin
Plugin URI: ....
...
*/
if(is_user_logged_in()){
function example(){
...
}
}
?>
like this, it shows me a error: the is_user_logged_in() is undefined.
but like this:
<?php
/*
Plugin Name: my plugin
Plugin URI: ....
...
*/
function example(){
if(is_user_logged_in()){
...
}
}
?>
it works!
can get me?
I think it's because is_user_logged_in() is located in wp-includes/pluggable.php and if you open the file it says at the top:
These functions can be replaced via plugins. If plugins do not redefine these functions, then these will be used instead.
ie, my-plugin-name.php is been loaded before pluggable.php.
oh, I think ur right!
thank u.:)
This topic has been closed to new replies.