Function Reference: geodir_detail_page_tab_headings_change_ctp

Summary

This function has not been documented yet.

Source File

geodir_detail_page_tab_headings_change_ctp() is located in geodir_custom_posts/geodir_cp_hooks_actions.php [Line: 233]

Source Code

function geodir_detail_page_tab_headings_change_ctp( $tabs_arr ) {
	global $wpdb;
	
	$post_type = geodir_get_current_posttype();
	$all_postypes = geodir_get_posttypes();
		
	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
		$geodir_post_types = get_option('geodir_post_types');
		if (empty($geodir_post_types[$post_type])) {
			return $tabs_arr;
		}
		$post_type_array = $geodir_post_types[$post_type];
		if (array_key_exists('post_profile', $tabs_arr) && !empty($post_type_array['labels']['label_post_profile'])) {
			$field_title = stripslashes_deep($post_type_array['labels']['label_post_profile']);
			
			if (isset($tabs_arr['post_profile']['heading_text']) && $field_title != '') {
				$tabs_arr['post_profile']['heading_text'] = __($field_title, GEODIR_CP_TEXTDOMAIN);
			}
		}
		
		if (array_key_exists('post_info', $tabs_arr) && !empty($post_type_array['labels']['label_post_info'])) {
			$field_title = stripslashes_deep($post_type_array['labels']['label_post_info']);
			
			if (isset($tabs_arr['post_info']['heading_text']) && $field_title != '') {
				$tabs_arr['post_info']['heading_text'] = __($field_title, GEODIR_CP_TEXTDOMAIN);
			}
		}
		
		if (array_key_exists('post_images', $tabs_arr) && !empty($post_type_array['labels']['label_post_images'])) {
			$field_title = stripslashes_deep($post_type_array['labels']['label_post_images']);
			
			if (isset($tabs_arr['post_images']['heading_text']) && $field_title != '') {
				$tabs_arr['post_images']['heading_text'] = __($field_title, GEODIR_CP_TEXTDOMAIN);
			}
		}
		
		if (array_key_exists('post_map', $tabs_arr) && !empty($post_type_array['labels']['label_post_map'])) {
			$field_title = stripslashes_deep($post_type_array['labels']['label_post_map']);
			
			if (isset($tabs_arr['post_map']['heading_text']) && $field_title != '') {
				$tabs_arr['post_map']['heading_text'] = __($field_title, GEODIR_CP_TEXTDOMAIN);
			}
		}
		
		if (array_key_exists('reviews', $tabs_arr) && !empty($post_type_array['labels']['label_reviews'])) {
			$field_title = stripslashes_deep($post_type_array['labels']['label_reviews']);
			
			if (isset($tabs_arr['reviews']['heading_text']) && $field_title != '') {
				$tabs_arr['reviews']['heading_text'] = __($field_title, GEODIR_CP_TEXTDOMAIN);
			}
		}
		
		if (array_key_exists('related_listing', $tabs_arr) && !empty($post_type_array['labels']['label_related_listing'])) {
			$field_title = stripslashes_deep($post_type_array['labels']['label_related_listing']);
			
			if (isset($tabs_arr['related_listing']['heading_text']) && $field_title != '') {
				$tabs_arr['related_listing']['heading_text'] = __($field_title, GEODIR_CP_TEXTDOMAIN);
			}
		}
	
	}
	
	return $tabs_arr;
}