0

I'm really hoping that someone can help me out here, I'm trying to give the admin the ability to choose a page for a button to link to. I've created the select using...

wp_dropdown_pages($args)

... and am creating the arguments via...

$args = array(
  'echo'  => 1,
  'selected' => $the_link,
  'name'  => 'theme_option[the_link]');

... and have attempted to save the value generated

$input['the_link'] = (int) $input['the_link'];

... but so far no luck. The selected option just resets once the form has been sent, and it doesn't look like the value is getting saved at all. Does anyone have any advice?

  • Post the code surrounding this line: $input['the_link'] = (int) $input['the_link']; – s_ha_dum Jul 1 '13 at 2:48
  • First of all, check the received data when the form is submitted : var_dump($_REQUEST); die();. Is the displayed value the intended one ? – Fabien Quatravaux Jul 1 '13 at 2:48
  • @ColoursB Please provide whole code so that we can debug it. – Vinod Dalvi Jul 1 '13 at 4:11
  • The whole shebang is here at pastebin.com/7TvvS2gP – ColoursB Jul 1 '13 at 5:00
0

Edit your args as following:

$args = array(
    'echo'      => 1,
    'selected'  => $options['the_link'],
    'name'      => 'critter_theme_options[the_link]'
);

No setting with the name 'theme_option' is set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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