Commits

David Gero committed 94ffe1b Draft

[m] show tranlation columns if has

Comments (0)

Files changed (1)

 }
 
 function gct_edit_columns($columns) {
-	$columns = array(
-		"cb" 			=> "<input type=\"checkbox\" />",
-		"title" 		=> __('Title','gc-testimonials'),
-		"client_name" 	=> __('Client','gc-testimonials'),
-		"thumbnail" 	=> __('Thumbnail','gc-testimonials'),
-		"category" 		=> __('Category','gc-testimonials'),
-		"shortcode" 	=> __('Shortcode','gc-testimonials'),
-		"date" 			=> __('Date','gc-testimonials'),
-	);
+	if(!empty($columns['icl_translations'])) {	
+		$columns = array(
+			"cb" 			=> "<input type=\"checkbox\" />",
+			"title" 		=> __('Title','gc-testimonials'),
+			"icl_translations" => $columns['icl_translations'],
+			"client_name" 	=> __('Client','gc-testimonials'),
+			"thumbnail" 	=> __('Thumbnail','gc-testimonials'),
+			"category" 		=> __('Category','gc-testimonials'),
+			"shortcode" 	=> __('Shortcode','gc-testimonials'),
+			"date" 			=> __('Date','gc-testimonials'),
+		);
+	} else {
+		$columns = array(
+			"cb" 			=> "<input type=\"checkbox\" />",
+			"title" 		=> __('Title','gc-testimonials'),
+			"client_name" 	=> __('Client','gc-testimonials'),
+			"thumbnail" 	=> __('Thumbnail','gc-testimonials'),
+			"category" 		=> __('Category','gc-testimonials'),
+			"shortcode" 	=> __('Shortcode','gc-testimonials'),
+			"date" 			=> __('Date','gc-testimonials'),
+		);
+	}
+	
 	return $columns;
 }