What is the method to test for the existence of an option in the database?
Not the value of the option, just that the option exists.
|
What is the method to test for the existence of an option in the database? Not the value of the option, just that the option exists. |
|||
|
|
|
Options that don't exist get the fact of their non-existence cached in memory when you attempt to get them. So you can check that cache to determine the difference.
|
|||
|
|
|
That's a pretty good question! Basically you can do several things to get around it, but the most easy is to check if your option is one of the array keys in the "autoloaded" options. Take a look at If this is the case, you can simply check the array keys like in the following example:
|
|||
|
|
|
Alternately,you could pass
The reason I suggest using |
|||
|
|