13 reputation
3
bio website
location
age
visits member for 1 year, 2 months
seen Mar 20 at 10:23

Aug
23
awarded  Popular Question
Feb
10
awarded  Scholar
Feb
10
comment Populating meta box with select-list of existing posts, and assigning it to custom post types
Simply beautiful, Mike. Works really well! Thanks for your help. :)
Feb
10
accepted Populating meta box with select-list of existing posts, and assigning it to custom post types
Feb
10
comment Populating meta box with select-list of existing posts, and assigning it to custom post types
Thanks for the reply Mike! I will try to clarify my desired outcome: I want a meta box similar to your LittleBoxes class. The difference is that I need to include it on custom post types, and I only need one meta box (not 3 like yours). Also I'd like to do this with as little code as possible so I can understand it and modify it later, which is why I started from scratch. As for the for loop: I thought I needed it to ID my option tags. I removed it in a later version, but I am still not able to save the data.
Feb
9
comment Populating meta box with select-list of existing posts, and assigning it to custom post types
Yeah my main problem now is that $_POST['selected_item'] is empty. So I need to get the selected option's value into the $_POST arra. Then I should be very close! I would edit the above post but there was a 5 minute time limit.
Feb
9
comment Populating meta box with select-list of existing posts, and assigning it to custom post types
Thanks for the answer, jevets. That helped me get the correct update_post_meta, but I think my $_POST array is empty. Do I need to add something to make sure my form data goes to the $_POST array? // Create the meta box content function select_box_content() { $selected_item = get_post_meta( get_the_ID(), '_selected_item', true ); $static_args = array( 'post_type' => 'partnerbedrift', 'show_option_none' => 'Choose item' ); wp_dropdown_pages($static_args); }
Feb
8
awarded  Student
Feb
8
asked Populating meta box with select-list of existing posts, and assigning it to custom post types