I want to populate the drop-down menu items of the CF7 from another database. The reason for this is that there might be a large number of items that might dynamically change every week. Adjusting the CF7 manually would be very frustrating.
I have tested the PHP with
XYZ PHP Code plugin and it works. The code looks like this
$mydb = new wpdb('User','Password','mytable','localhost'); $rows = $mydb->get_results("SELECT `brand_name` FROM `brands`"); foreach ($rows as $obj) : echo ""$obj->brand_name" "; endforeach;
The result of the script is values in double quotes, as requested by CF7 (Select):
"Taylor" "Line 6" "Kurzweil" "Nord"
Unfortunately, I cannot nest the short code of
XYZ PHP Code into another short code of CF7.
This obviously cannot work:
(select menu-446 (xyz-ips snippet="brands"))
Is there a way to do this?