I'm creating custom elements for Visual Composer WP Plugin. In functions.php, I'm referencing each block so that it loads in the admin side:
function vc_before_init_actions() {
require_once('vc_elements/hero/hero.php');
require_once('vc_elements/text-image/text-image.php' );
}
However, if I have twenty custom elements, I'll have to reference them all individually. Is there a way to just load all blocks that are in the vc_elements folder?
I know a potential stumbling block would be the fact that each of my custom elements are in different folders (i.e. hero.php is in vc_elements > hero > hero.php). Is it possible with my current folder structure?