I'm trying to populate a ACF select field with an array from a custom $wpdb->get_results call, which is essentially a list of categories from my db.
I have the following:
global $wpdb;
$wpdb->show_errors();
$myArray = $wpdb->get_row("SELECT cat_name FROM wp_wpfb_cats WHERE cat_parent = '0'", ARRAY_A);
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => '5040bc74e47c3',
'title' => 'Folder Name',
'fields' =>
array (
0 =>
array (
'key' => 'field_503e2aef44bc0',
'label' => 'My Label',
'name' => 'my_label_name',
'type' => 'select',
'instructions' => '',
'required' => '1',
'choices' => array (
$myArray
),
'default_value' => '',
'allow_null' => '0',
'multiple' => '0',
'order_no' => '0',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'clientspage',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
}
How can I go about pushing my results into this ACF select field? I currently get:


register_field_groupis not a Wordpress function. What (plugin) defined it? – janw Aug 31 '12 at 14:25