WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


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

Try this:

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

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

try to debug your application.

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... – qwerty qwerty Nov 14 '12 at 6:42

Your Answer


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.