function _shortcode_get_shortcodes in Shortcode 7.2
Get enabled ShortCodes for a given filter.
Parameters
object $filter: The filters object.
Return value
array The enabled ShortCodes array for the input format.
2 calls to _shortcode_get_shortcodes()
- _shortcode_process in ./
shortcode.module - Processes the ShortCodes according to the text and the text format.
- _shortcode_process_tag in ./
shortcode.module - Regular Expression callable for do_shortcode() for calling ShortCode hook.
File
- ./
shortcode.module, line 153 - Provides ShortCodes filter framework and API (like WP ShortCodes)
Code
function _shortcode_get_shortcodes($filter) {
$shortcodes_enabled =& drupal_static(__FUNCTION__, array());
if (!isset($shortcodes_enabled[$filter->format])) {
$shortcodes_enabled[$filter->format] = array();
$shortcodes = shortcode_list_all();
foreach ($filter->settings as $name => $value) {
if ($value && !empty($shortcodes[$name]['process callback'])) {
$shortcodes_enabled[$filter->format][$name] = array(
'function' => $shortcodes[$name]['process callback'],
);
}
}
}
return $shortcodes_enabled[$filter->format];
}