1

When I use vc_map() to add a new element to the content element list there is the category parameter to put the element in a certain tab.

If there are to many category tabs, VC will put some of them in a dropdown list on the right hand side. Is there a way to rearrange the order of all tabs?

enter image description here

s3mre8
  • 288
  • 1
  • 4
  • 11

2 Answers2

1

There's a filter that can be hooked into to rearrange the order of the element categories: vc_add_element_categories.

For example:

add_filter( 'vc_add_element_categories', 'rearrange_element_categories', 10, 1 );

function rearrange_element_categories( $tabs ) {
  // rearrange the tabs according to your needs
  return $rearranged_tabs;
}
dilico
  • 694
  • 1
  • 6
  • 14
0

Don't know why someone would need this? Still you can arrange this as per your choice by jumping into plugin's code.

Con:

It will get reset, when in future you will be updating the plugin. And as per our understanding for WPBakery Page Builder plugin, you can't survive by without updating it.

Navnish Bhardwaj
  • 1,687
  • 25
  • 39
  • Rearrange because some categories are maybe more often used then others. So if you have a important category in the dropdown it would be harder to find for the user and you would need one more click to access it. – s3mre8 Feb 19 '20 at 09:44
  • 1
    They provide search in the right, so just by typing first two characters, you can get results. As we don't recommend, making changes to the code of plugin which gets timely updates. – Navnish Bhardwaj Feb 19 '20 at 09:46
  • Yep, i know and that is what i will explain to the user. But anyway I wonder if there is no easy method to define the order. Somehow this is already ordered but i dont see how.First some WP elements followed by theme items, then some Ultimate VC Plugin items, then again some theme items and then my own category in the dropdown. How could i have mine first? – s3mre8 Feb 19 '20 at 10:42