Add a new tab to the category tabs under edit post area

[eye_row data_cont=”fixed” data_container_extra_samll=”100%” data_container_small=”540px” data_container_medium=”720px” data_container_large=”960px” data_container_x_large=”1140px” data_container_xx_large=”1320px” data_res_devices=”lg” data_container_sm_extra_samll=”100%” data_container_sm_small=”540px” data_container_sm_medium=”720px” data_container_sm_large=”960px” data_container_sm_x_large=”1140px” data_container_sm_xx_large=”1320px” data_container_md_extra_samll=”100%” data_container_md_small=”100%” data_container_md_medium=”720px” data_container_md_large=”960px” data_container_md_x_large=”1140px” data_container_md_xx_large=”1320px” data_container_lg_extra_samll=”100%” data_container_lg_small=”100%” data_container_lg_medium=”100%” data_container_lg_large=”960px” data_container_lg_x_large=”1140px” data_container_lg_xx_large=”1320px” data_container_xl_extra_samll=”100%” data_container_xl_small=”100%” data_container_xl_medium=”100%” data_container_xl_large=”100%” data_container_xl_x_large=”1140px” data_container_xl_xx_large=”1320px” data_container_xxl_extra_samll=”100%” data_container_xxl_small=”100%” data_container_xxl_medium=”100%” data_container_xxl_large=”100%” data_container_xxl_x_large=”100%” data_container_xxl_xx_large=”1320px” data_container_fluid_extra_samll=”100%” data_container_fluid_small=”100%” data_container_fluid_medium=”100%” data_container_fluid_large=”100%” data_container_fluid_x_large=”100%” data_container_fluid_xx_large=”100%” data_col_nested=”no” data_width_xxl=”0″ data_width_xl=”0″ data_width_lg=”0″ data_width_md=”0″ data_width_sm=”0″ data_width_xs=”0″ data_gutters=”30px” data_bgopt=”normal” data_bg_type=”classic” data_bg_position=”top center” data_bg_repeat=”no-repeat” data_bg_attachment=”scroll” data_bg_size=”cover” data_bg_parallax_ratio=”0.5″ data_shortcode_id=”0fpcyq1oc”][eye_column data_width=”7″ data_desktop=”0″ data_tablet=”0″ data_mobile=”0″ data_offset_xl=”0″ data_offset_lg=”0″ data_offset_md=”0″ data_offset_sm=”0″ data_order_xl=”0″ data_order_lg=”0″ data_order_md=”0″ data_order_sm=”0″ data_bg_position=”top center” data_bg_repeat=”no-repeat” data_bg_attachment=”scroll” data_bg_size=”cover” data_bg_parallax_ratio=”0.5″ data_shortcode_id=”1e57ej3bo7″][eye_text shortcode_id=”ej27dr0s1″ main_tab=”undefined” button_tab_right=”undefined” font_type=”system” font_devices=”undefined” size_xxl_type=”px” size_xxl_px=”1″ size_xl_type=”px” size_xl_px=”1″ size_lg_type=”px” size_lg_px=”1″ size_md_type=”px” size_md_px=”1″ size_sm_type=”px” size_sm_px=”1″ text_align=”left” font_line_height=”undefined” line_height_xxl_type=”px” line_height_xxl_px=”1″ line_height_xl_type=”px” line_height_xl_px=”1″ line_height_lg_type=”px” line_height_lg_px=”1″ line_height_md_type=”px” line_height_md_px=”1″ line_height_sm_type=”px” line_height_sm_px=”1″ font_letter_spacing=”undefined” letter_spacing_xxl_type=”px” letter_spacing_xxl_px=”1″ letter_spacing_xl_type=”px” letter_spacing_xl_px=”1″ letter_spacing_lg_type=”px” letter_spacing_lg_px=”1″ letter_spacing_md_type=”px” letter_spacing_md_px=”1″ letter_spacing_sm_type=”px” letter_spacing_sm_px=”1″ devices=”undefined” padding_row_xl=”0,15px,0,15px” padding_row_lg=”0,15px,0,15px” padding_row_md=”0,15px,0,15px” padding_row_sm=”0,15px,0,15px” bgopt=”undefined” bg_type=”classic” bg_position=”top center” bg_repeat=”no-repeat” bg_attachment=”scroll” bg_size=”cover” bg_parallax_ratio=”0.5″ heading_css=”undefined” heading_js=”undefined”]

Here’s the script that we can enqueue into our admin panel. It will add a new tab to the category tabs called “Active”. Whenever a checkbox is checked, it gets added to the “Active” tab list, you can also click links in the “Active” tab list to remove them ( uncheck them ).

[/eye_text][/eye_column][eye_column data_width=”5″ data_shortcode_id=”d9jkmxmr9″][eye_image align=”none”]1155|https://codex.deshisoft.com/wp-content/uploads/2021/05/category-acitve-tab.jpg|full[/eye_image][/eye_column][/eye_row][eye_row data_cont=”fixed” data_container_extra_samll=”100%” data_container_small=”540px” data_container_medium=”720px” data_container_large=”960px” data_container_x_large=”1140px” data_container_xx_large=”1320px” data_res_devices=”lg” data_container_sm_extra_samll=”100%” data_container_sm_small=”540px” data_container_sm_medium=”720px” data_container_sm_large=”960px” data_container_sm_x_large=”1140px” data_container_sm_xx_large=”1320px” data_container_md_extra_samll=”100%” data_container_md_small=”100%” data_container_md_medium=”720px” data_container_md_large=”960px” data_container_md_x_large=”1140px” data_container_md_xx_large=”1320px” data_container_lg_extra_samll=”100%” data_container_lg_small=”100%” data_container_lg_medium=”100%” data_container_lg_large=”960px” data_container_lg_x_large=”1140px” data_container_lg_xx_large=”1320px” data_container_xl_extra_samll=”100%” data_container_xl_small=”100%” data_container_xl_medium=”100%” data_container_xl_large=”100%” data_container_xl_x_large=”1140px” data_container_xl_xx_large=”1320px” data_container_xxl_extra_samll=”100%” data_container_xxl_small=”100%” data_container_xxl_medium=”100%” data_container_xxl_large=”100%” data_container_xxl_x_large=”100%” data_container_xxl_xx_large=”1320px” data_container_fluid_extra_samll=”100%” data_container_fluid_small=”100%” data_container_fluid_medium=”100%” data_container_fluid_large=”100%” data_container_fluid_x_large=”100%” data_container_fluid_xx_large=”100%” data_col_nested=”no” data_width_xxl=”0″ data_width_xl=”0″ data_width_lg=”0″ data_width_md=”0″ data_width_sm=”0″ data_width_xs=”0″ data_gutters=”30px” data_bgopt=”normal” data_bg_type=”classic” data_bg_position=”top center” data_bg_repeat=”no-repeat” data_bg_attachment=”scroll” data_bg_size=”cover” data_bg_parallax_ratio=”0.5″ data_shortcode_id=”qd0emgamkl”][eye_column data_width=”0-12-0″ data_desktop=”0″ data_tablet=”0″ data_mobile=”0″ data_offset_xl=”0″ data_offset_lg=”0″ data_offset_md=”0″ data_offset_sm=”0″ data_order_xl=”0″ data_order_lg=”0″ data_order_md=”0″ data_order_sm=”0″ data_bg_position=”top center” data_bg_repeat=”no-repeat” data_bg_attachment=”scroll” data_bg_size=”cover” data_bg_parallax_ratio=”0.5″ data_shortcode_id=”2tyj2rm0ro”][eye_text shortcode_id=”q4lxygvlx” main_tab=”undefined” button_tab_right=”undefined” font_type=”system” font_devices=”undefined” size_xxl_type=”px” size_xxl_px=”1″ size_xl_type=”px” size_xl_px=”1″ size_lg_type=”px” size_lg_px=”1″ size_md_type=”px” size_md_px=”1″ size_sm_type=”px” size_sm_px=”1″ text_align=”left” font_line_height=”undefined” line_height_xxl_type=”px” line_height_xxl_px=”1″ line_height_xl_type=”px” line_height_xl_px=”1″ line_height_lg_type=”px” line_height_lg_px=”1″ line_height_md_type=”px” line_height_md_px=”1″ line_height_sm_type=”px” line_height_sm_px=”1″ font_letter_spacing=”undefined” letter_spacing_xxl_type=”px” letter_spacing_xxl_px=”1″ letter_spacing_xl_type=”px” letter_spacing_xl_px=”1″ letter_spacing_lg_type=”px” letter_spacing_lg_px=”1″ letter_spacing_md_type=”px” letter_spacing_md_px=”1″ letter_spacing_sm_type=”px” letter_spacing_sm_px=”1″ devices=”undefined” padding_row_xl=”0,15px,0,15px” padding_row_lg=”0,15px,0,15px” padding_row_md=”0,15px,0,15px” padding_row_sm=”0,15px,0,15px” bgopt=”undefined” bg_type=”classic” bg_position=”top center” bg_repeat=”no-repeat” bg_attachment=”scroll” bg_size=”cover” bg_parallax_ratio=”0.5″ heading_css=”undefined” heading_js=”undefined”]

Add this as an external script, active-tab.js maybe:

[/eye_text][eye_html]PHByZSBjbGFzcz0icHJldHR5cHJpbnQgbGluZW51bXMiPgpqUXVlcnkoIGRvY3VtZW50ICkucmVhZHkoIGZ1bmN0aW9uKCAkICkgewoKICAgIC8qIEVuc3VyZSB0aGF0IHRoZXJlIGFyZSBjYXRlZ29yeSBtZXRhYm94ZXMgKi8KICAgIGlmKCAkKCAndWwuY2F0ZWdvcnktdGFicycgKS5sZW5ndGggKSB7CiAgICAgICAgdmFyIHRheG9ub21pZXMgPSBbICdjYXRlZ29yeScsICd0YWcnIF07IC8qIFRheG9ub215IFNsdWdzICggY2F0ZWdvcnkgYW5kIHRhZyBhcmUgYnVpbHQtaW4gKSAqLwoKICAgICAgICAvKiBMb29wIHRocm91Z2ggZWFjaCBjYXRlZ29yeSBtZXRhYm94IGFuZCBhZGQgYSBuZXcgdGFiICovCiAgICAgICAgJC5lYWNoKCB0YXhvbm9taWVzLCBmdW5jdGlvbigga2V5LCB0YXhvbm9teSApIHsKCiAgICAgICAgICAgIC8qIEFkZCBhIGNoZWNrYm94IGxpc3RlbmVyICovCiAgICAgICAgICAgIC8qIFdoZW5ldmVyIGEgY2hlY2tib3ggaXMgY2hlY2tlZCBvciB1bmNoZWNrZWQsIHJlbW92ZSAnQWN0aXZlJyB0YWIgbGlzdCBpdGVtICovCiAgICAgICAgICAgICQoICcjdGF4b25vbXktJyArIHRheG9ub215ICsgJyB1bC5jYXRlZ29yeWNoZWNrbGlzdCBpbnB1dFt0eXBlPSJjaGVja2JveCJdJyApLmNoYW5nZSggZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICB2YXIgbGFiZWwgICA9ICQoIHRoaXMgKS5wYXJlbnQoKS50ZXh0KCkudHJpbSgpOyAgICAgLyogR3JhYiBjaGVja2JveCBsYWJlbCAqLwogICAgICAgICAgICAgICAgdmFyIHZhbHVlICAgPSAkKCB0aGlzICkudmFsKCk7ICAgICAgICAgICAgICAgICAgICAgIC8qIEdyYWIgY2hlY2tib3ggdmFsdWUgKi8KCiAgICAgICAgICAgICAgICAvKiBJRiBpdCBpcyBjaGVja2VkLCBhZGQgaXQgdG8gdGhlICdBY3RpdmUnIHRhYiAqLwogICAgICAgICAgICAgICAgaWYoICQoIHRoaXMgKS5pcyggJzpjaGVja2VkJyApICkgewogICAgICAgICAgICAgICAgICAgICQoICcjJyArIHRheG9ub215ICsgJy1hY3RpdmUgdWwnICkuYXBwZW5kKCAnPGxpIGRhdGEtdmFsPSInICsgdmFsdWUgKyAnIj48YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCk7Ij48c3BhbiBjbGFzcz0iZGFzaGljb25zIGRhc2hpY29ucy1uby1hbHQiIHN0eWxlPSJmb250LXNpemU6MThweDt0ZXh0LWRlY29yYXRpb246bm9uZTttYXJnaW4tcmlnaHQ6NHB4OyI+PC9zcGFuPicgKyBsYWJlbCArICc8L2E+PC9saT4nICk7CgogICAgICAgICAgICAgICAgLyogSUYgaXQgaXMgdW5jaGVja2VkLCByZW1vdmUgaXQgZnJvbSB0aGUgJ0FjdGl2ZScgdGFiICovCiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICQoICcjJyArIHRheG9ub215ICsgJy1hY3RpdmUgbGlbZGF0YS12YWw9IicgKyB2YWx1ZSArJyJdJyApLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9ICk7CgogICAgICAgICAgICAvKiBBZGQgY2xpY2sgbGlzdGVuZXIgdG8gdGhlIG5ld2x5IGFkZGVkICdBY3RpdmUnIHRhYiBsaW5rcyAqLwogICAgICAgICAgICAkKCAnZGl2Lmluc2lkZScgKS5vbiggJ2NsaWNrJywgJyMnICsgdGF4b25vbXkgKyAnLWFjdGl2ZSBhJywgZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSAkKCB0aGlzICkucGFyZW50KCkuYXR0ciggJ2RhdGEtdmFsJyApOwoKICAgICAgICAgICAgICAgIC8qIFVuY2hlY2sgYW55IHZhbHVlcyB0aGF0IGhhdmUgdGhlIGNsaWNrZWQgdmFsdWUgKi8KICAgICAgICAgICAgICAgICQoIHRoaXMgKS5wYXJlbnRzKCAnZGl2Lmluc2lkZScgKS5maW5kKCAnaW5wdXRbdmFsdWU9IicgKyB2YWx1ZSArJyJdJyApLnByb3AoICdjaGVja2VkJywgZmFsc2UgKTsKCiAgICAgICAgICAgICAgICAvKiBSZW1vdmUgJ0FjdGl2ZScgdGFiIGxpbmsgKi8KICAgICAgICAgICAgICAgICQoIHRoaXMgKS5wYXJlbnQoKS5yZW1vdmUoKTsKICAgICAgICAgICAgfSApOwoKICAgICAgICAgICAgLyogQXBwZW5kIGFuICdBY3RpdmUnIHRhYiAqLwogICAgICAgICAgICAkKCAnIycgKyB0YXhvbm9teSArICctdGFicycgKS5hcHBlbmQoICc8bGk+PGEgaHJlZj0iIycgKyB0YXhvbm9teSArICctYWN0aXZlIj5BY3RpdmU8L2E+PC9saT4nICk7CiAgICAgICAgICAgICRwYXJlbnQgPSAkKCAnIycgKyB0YXhvbm9teSArICctdGFicycgKS5wYXJlbnRzKCAnZGl2Lmluc2lkZScgKTsKCiAgICAgICAgICAgIC8qIEFkZCB0aGUgJ0FjdGl2ZScgdGFiIHBhbmVsIGFuZCBjb250ZW50IC0gZGlzcGxheSBub25lICovCiAgICAgICAgICAgICRwYXJlbnQuZmluZCggJ2Rpdi50YWJzLXBhbmVsOmxhc3QnICkuYmVmb3JlKCAnPGRpdiBpZD0iJyArIHRheG9ub215ICsgJy1hY3RpdmUiIGNsYXNzPSJ0YWJzLXBhbmVsIiBzdHlsZT0iZGlzcGxheTogbm9uZTsiPjx1bD48L3VsPjwvZGl2PicgKTsKCiAgICAgICAgICAgIC8qIElGIHRoZXJlIGFyZSBhbnkgY2hlY2tlZCB2YWx1ZXMgb24gbG9hZCwgdHJpZ2dlciBjaGFuZ2UuICovCiAgICAgICAgICAgICRwYXJlbnQuZmluZCggJyMnICsgdGF4b25vbXkgKyAnLWFsbCBpbnB1dDpjaGVja2VkJyApLmVhY2goIGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgJCggdGhpcyApLnRyaWdnZXIoICdjaGFuZ2UnICk7CiAgICAgICAgICAgIH0gKTsKCiAgICAgICAgfSApOwoKICAgIH0KCn0gKTsKPC9wcmU+[/eye_html][eye_text shortcode_id=”h80ab0a5s6″ main_tab=”undefined” button_tab_right=”undefined” font_type=”system” font_devices=”undefined” size_xxl_type=”px” size_xxl_px=”1″ size_xl_type=”px” size_xl_px=”1″ size_lg_type=”px” size_lg_px=”1″ size_md_type=”px” size_md_px=”1″ size_sm_type=”px” size_sm_px=”1″ text_align=”left” font_line_height=”undefined” line_height_xxl_type=”px” line_height_xxl_px=”1″ line_height_xl_type=”px” line_height_xl_px=”1″ line_height_lg_type=”px” line_height_lg_px=”1″ line_height_md_type=”px” line_height_md_px=”1″ line_height_sm_type=”px” line_height_sm_px=”1″ font_letter_spacing=”undefined” letter_spacing_xxl_type=”px” letter_spacing_xxl_px=”1″ letter_spacing_xl_type=”px” letter_spacing_xl_px=”1″ letter_spacing_lg_type=”px” letter_spacing_lg_px=”1″ letter_spacing_md_type=”px” letter_spacing_md_px=”1″ letter_spacing_sm_type=”px” letter_spacing_sm_px=”1″ devices=”undefined” padding_row_xl=”0,15px,0,15px” padding_row_lg=”0,15px,0,15px” padding_row_md=”0,15px,0,15px” padding_row_sm=”0,15px,0,15px” bgopt=”undefined” bg_type=”classic” bg_position=”top center” bg_repeat=”no-repeat” bg_attachment=”scroll” bg_size=”cover” bg_parallax_ratio=”0.5″ heading_css=”undefined” heading_js=”undefined”]

Next we can enqueue it into our admin panel:

[/eye_text][eye_html]PHByZSBjbGFzcz0icHJldHR5cHJpbnQgbGluZW51bXMiPgpmdW5jdGlvbiBsb2FkX2FjdGl2ZV90YWJzX3NjcmlwdHMoKSB7CiAgICB3cF9lbnF1ZXVlX3NjcmlwdCggJ2FjdGl2ZV90YWJzJywgZ2V0X3RlbXBsYXRlX2RpcmVjdG9yeV91cmkoKSAuICcvanMvYWN0aXZlLXRhYnMuanMnICk7Cn0KYWRkX2FjdGlvbiggJ2FkbWluX2VucXVldWVfc2NyaXB0cycsICdsb2FkX2FjdGl2ZV90YWJzX3NjcmlwdHMnICk7CjwvcHJlPg==[/eye_html][/eye_column][/eye_row]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>