Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Title may not be clear but I'm using update_option($my_option, $new_order); and for some reason it would not work but if instead I change to update_option('my-option-name' $new_order); it works.

I check that $my_option has a value and 'my-option-name' exists and has some values on it.

Without digging more, is there any reason or cases where using a $variable may stop the update_option(), If so, how can be sorted.

Thanks

share|improve this question
    
We need more code give an answer. The only reason is that $variable is either not set or has a wrong value. –  toscho Nov 14 '12 at 4:01

2 Answers 2

it's posible only if your variable not exists at the moment of function update_option executes...

try to debug your application.

var_dump($variable,$data);
update_option($variable,$data);
share|improve this answer
    
That’s not how var_dump() works. The second argument controls the display option. –  toscho Nov 14 '12 at 6:41
    
your right Toscho, too much console.log from yesterday... but anyway debuging update code is only way to ensure that we have a problem... –  Oleg Butuzov Nov 14 '12 at 6:42

Try this:

$optionname = 'option_1';
update_option( 'prefix_' . $optionname, $option_value );
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.