I’ve created an extra tab on the details page for my product_providers CPT. I’ve used the following code to add it:
//Directory Details Page
add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend') ;
function geodir_detail_page_tab_list_extend($tab_array)
{
$tab_array['company-information'] = array(
'heading_text' => __('Company Information',GEODIRECTORY_TEXTDOMAIN),
'is_active_tab' => false,
'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'company-information'),
'tab_content' => ''
);
return $tab_array ;
}
add_action('geodir_after_tab_content' ,'geodir_my_new_tab_content');
function geodir_my_new_tab_content($tab_index)
{
global $post;
if($tab_index =='company-information')
{
global $wpdb;
$id = get_the_ID();
$companydescription = $wpdb->get_var("SELECT geodir_products_companyname FROM geodir_gd_product_providers_detail WHERE post_id = $id ");
echo $companydescription;
}
}
The tab shows up fine and when I add straight text it works. It doesn’t when I’ve tried to add the custom field products_companyname. I was just wondering if you all knew what was wrong.