Hi,
A bug in the file config-templatebuilder/config.php line 11 add_shortcode_folder($paths) makes it impossible to add a custom folder.
function add_shortcode_folder($paths)
{
$paths = array(dirname(__FILE__) ."/avia-shortcodes/");
return $paths;
}
should be
function add_shortcode_folder($paths)
{
$paths[] = dirname(__FILE__) ."/avia-shortcodes/";
return $paths;
}
Otherwise every custom added folder added by “add_filter(‘avia_load_shortcodes’,’add_shortcode_folder’);” to the $paths variable is overridden instantly.
Best,
Markus
Hi!
Can you paste the complete avia_load_shortcodes code you’re trying to use? it should be something like this (child theme environment):
add_filter('avia_load_shortcodes', function($paths) {
$template_url = get_stylesheet_directory();
array_unshift($paths, $template_url.'/shortcodes/');
return $paths;
}, 15, 1);
Cheers!
Josue
My first try was:
//set the folder that contains the shortcodes
function myplugin_add_shortcode_folder($paths)
{
$paths = array(dirname(__FILE__) ."/avia-shortcodes/");
return $paths;
}
add_filter('avia_load_shortcodes', 'myplugin_add_shortcode_folder');
I ended up with:
//set the folder that contains the shortcodes
function myplugin_add_shortcode_folder($paths)
{
$paths[] = dirname(__FILE__) . "/avia-shortcodes/";
return $paths;
}
add_filter('avia_load_shortcodes', 'myplugin_add_shortcode_folder');
But thx for the workaround with a lower prio, that should also do the trick.