cmb2-tabs icon indicating copy to clipboard operation
cmb2-tabs copied to clipboard

Does anyone know if its possible to show tabs conditionally?

Open pgroot91 opened this issue 5 years ago • 2 comments

Hi Guys,

Just trying to figure out if its possible to show tabs conditionally. First thought was something like cmb2-conditionals... But this seems to be used only for fields.

Then also came to my intention is the "show_on/show_on_cb" solution. This is something i haven't tried myself yet so will look into this. But hoped to find people here that encountered the same thing.

Any other solutions available to your knowledge that may work?

pgroot91 avatar Apr 23 '20 11:04 pgroot91

Just to my surprise someone already made a PR for the show_on_cb solution #23 . Will give this a spin and see if this works out for me.

pgroot91 avatar Apr 23 '20 11:04 pgroot91

I have tested the branch and have some problems with the implementation.

  1. You need to have the "show_on_cb" specified on your tabs or you will get the following notices.

Notice: Undefined index: show_on_cb in C:\xampp\htdocs\dev1\wp-content\plugins\my-plugin\includes\cmb2-tabs\inc\cmb2-tabs.class.php on line 67 Notice: Undefined index: show_on_cb in C:\xampp\htdocs\dev1\wp-content\plugins\my-plugin\includes\cmb2-tabs\inc\cmb2-tabs.class.php on line 79

pgroot91 avatar Apr 23 '20 12:04 pgroot91