From a3f1f4915dda758b77e563a320322e7230c6d224 Mon Sep 17 00:00:00 2001 From: Alberto Miconi Date: Tue, 12 Jun 2018 17:07:02 +0200 Subject: [PATCH] Update cmb2-tabs.class.php --- inc/cmb2-tabs.class.php | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/inc/cmb2-tabs.class.php b/inc/cmb2-tabs.class.php index 562c342..4332bd9 100644 --- a/inc/cmb2-tabs.class.php +++ b/inc/cmb2-tabs.class.php @@ -62,19 +62,33 @@ public function get_tabs() { ?> - setting['tabs'] as $key => $tab ): ?> -
+ setting['tabs'] as $key => $tab ): + $show_callback = $tab["show_on_cb"]; + $show_callback = function_exists($show_callback) ? call_user_func($show_callback) : true; + if($show_callback) { + ?> +
render_fields( $this->setting['config'], $tab['fields'], $this->object_id ); ?> -
- +