using this:
defined('WPLANG')
I’m able to check whether the constant is defined or not, but how can I check the value of the constant to use it in an if statement?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Or
It’s good to check if the constant is defined before checking its value, since
if ( I_AM_UNDEFINED )will always befalse, because the value of an undefined constant isnull. If you assume it exists and it doesn’t, then you could get some unexpected results. So: