[wp-hackers] get_option returns just fine in one file, returns null in another

Ryan Bilesky rbilesky at gmail.com
Tue Mar 1 02:28:07 UTC 2011


ok calling "$options = get_option('power_tickets');" inside of the function
works fine I guess, I just called it once at the top of the file outside of
any functions so I wouldn't have to do that for every function but heh i
guess this works.

On Mon, Feb 28, 2011 at 6:15 PM, Ryan Bilesky <rbilesky at gmail.com> wrote:

> This is real odd, if within the file that I am having problems with I add a
> simple test function with this code:
>
>  $options = get_option('power_tickets');
>  echo '<pre>';
>  var_dump ($options['dept']);
>  echo '</pre>';
>
> and I hook into admin_notices to fire that, it works, but just doing
>
> $options = get_option('power_tickets');
> at the begining of the file doesn't seem to work, though it doesn't have
> that problem on other files.
>
>
> On Mon, Feb 28, 2011 at 5:44 PM, Ryan Bilesky <rbilesky at gmail.com> wrote:
>
>> So this is what I have
>>
>> $options = get_option('power_tickets');
>>
>> If i var_dump $options in one file i get the array of options i expect to
>> see, in another file in my plugin a var_dump is returning null, any ideas I
>> have no clue what would cause this it makes no sense to me.  Any ideas
>> anyone because this has got me stumped.
>>
>
>


More information about the wp-hackers mailing list