I am running the following in my functions.php file:
$query = new WP_Query(array(
'post_type' => 'gear',
'orderby' => 'title',
'order' => 'ASC',
'author' => $current_user->ID,
'posts_per_page' => -1,
'meta_key' => 'brand_preselect',
'orderby' => 'meta_value',
'meta_key' => 'category_tax',
'orderby' => 'meta_value',
));
foreach($query->posts as $product_id=>$macthed_product){
$choices[$macthed_product->ID] = '<span>' . $macthed_product->brand_preselect . '</span>' . $macthed_product->post_title;
}
This all works pretty well, but the problem is $macthed_product->brand_preselect is returning the value of the checkbox and not the Label. On this field (brand_preselect) I have it only set to return the Label though. How do I get it to return the Label and not the value?