Hi Paul,
The below example would remove the tab “more_details” for all posts that are not in the cat with ID = 100.
Its best to use the tab key rather than the name (the tab key is what appears after the # when u click the tab).
add_filter('geodir_tab_settings','_my_tabs_edit',10,2);
function _my_tabs_edit($tabs,$post_type){
global $gd_post;
if(!empty($tabs) && !empty($gd_post->post_category)){
$cats = array_filter(explode(",",$gd_post->post_category));
$cat_id = 100; // set id here
$remove_tab_key = "more_details"; // set tab key here
if( !in_array($cat_id,$cats) ){
foreach($tabs as $key => $tab){
if($tab->tab_key==$remove_tab_key){
unset($tabs[$key]);// remove the tab
}
}
}
}
return $tabs;
}
Hope this helps.
Thanks,
Stiofan