Custom fields to populate select menu
-
Hello
I wonder if someone can help me out.
I’m working on an education site which has an existing booking form for courses. The data for the select menus on the form is supplied by two arrays which are currently entered manually. I’d like to automate it so that the site owner can use custom fields to supply the data for the form – so the form does a SELECT query on the WP database to work out what goes in the array.
The existing arrays look like this:
//First array - course code and title $courses = array('NIL' => 'please select', '001' => '4 Day residential', '002' => '6 Day residential'); //Second array - price, deposit, date, skill level $price = array('NIL' => array(0,0, '', 1), '001' => array(200,100, '5th - 8th June 2008', 1), '002' => array(300,150, '24th - 27th July 2008', 2);My plan with the automated version is that the first array would use
IDandpost_title, and the second,IDand four custom field values.I’ve been using the queries from Displaying Posts Using a Custom Select Query which work fine for output in the loop and so on – but I can’t figure out how to go about storing the results of my queries in the two arrays.
If anyone could shed any light that would be much appreciated.
The topic ‘Custom fields to populate select menu’ is closed to new replies.