2017-08-07 4 views

答えて

0

a。 「geodir_togReview」という名前のチェックボックスフィールドを作成します:GD->プレイス設定 - >チェックボックス - > HTML変数名を「togReview」に設定します。

b。 geodirectory-compatibility.phpで追加

// this line tells the tabs function to run our new function to remove a tab 
add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_remove_tab_conditional'); 

// this function removes the tab to the tabs list 
function geodir_detail_page_tab_list_remove_tab_conditional($tab_array) 
{ 
    // the $post var contains all the listing info so we can add conditions 
    global $post, $preview; 

    if ($preview) 
     $is_place = $post->listing_type=='gd_place'; 
    else 
     $is_place = $post->post_type=='gd_place'; 

    // HIDE OR SHOW 
    if ($is_place && $post->geodir_togReview) { 
     $tab_array['reviews']['is_active_tab'] = 0; 
     $tab_array['reviews']['is_display'] = 0; 
     //unset($tab_array['reviews']);//remove the tab 
    } else { 
     $tab_array['reviews']['is_active_tab'] = 1; 
     $tab_array['reviews']['is_display'] = 1; 
    } 


    return $tab_array; 
} 
関連する問題