function _xbbcode_get_handlers in Extensible BBCode 5
Same name and namespace in other branches
- 6 xbbcode.inc \_xbbcode_get_handlers()
2 calls to _xbbcode_get_handlers()
File
- ./
xbbcode-misc.php, line 5
Code
function _xbbcode_get_handlers() {
// This function does not use caching because it is used only in the settings page.
$all = array();
$modules = module_implements('xbbcode');
foreach ($modules as $module) {
$tags = module_invoke($module, 'xbbcode', 'list');
if (is_array($tags)) {
foreach ($tags as $i => $tag) {
if (!preg_match('/^[a-z0-9]+$/i', $tag)) {
unset($tags[$i]);
}
else {
$tags[$i] = array(
'name' => $tag,
'module' => $module,
);
}
}
$all = array_merge($all, $tags);
}
}
return $all;
}