Hi,
I want to add new roles to BBpress. I have a functioning code if I add it directly to functions.php, but I would like to add it to a separate file called bbpress.php in /app folder in order to organize everything.
I tried to add the file in the following code:
array_map(function ($file) use ($sage_error) {
$file = “…/app/{$file}.php”;
if (!locate_template($file, true, true)) {
$sage_error(sprintf(__(‘Error locating %s
for inclusion.’, ‘sage’), $file), ‘File not found’);
}
}, [‘helpers’, ‘setup’, ‘filters’, ‘admin’]);
It does not work and I think the problem is that the creation of roles need to be called at a later stage for it to work.
What is the best way to do this with Sage 9.0?
Thanks in advance