wp_dropdown_pages() in theme admin page

Scratching my head on this one.
I have a theme option page, where I need the user to select a page to show at X location.
I am using wp_dropdown_pages() to list my pages, and they show.
But, I can’t seem to be able to save the data/option and make sure the correct option is selected.

Page list displaying correctly

$args = array(,
'echo'             => 1,
'selected' => $home_galleryselect,
'name'             => 'home_galleryselect');
 wp_dropdown_pages($args); 

function to update

function theme_options_validate($input) {
$input['home_galleryselect'] = (int) $input['home_galleryselect'];
return $input;  
} 

Help!
thx

1 Answer
1

grrr.really annoying, 2hrs and then i found it myself

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

Leave a Comment