Exemple #1
0
/**
 * Load extension: helpers, hooks, widgets, and shortcodes
 * @param  string $type: helpers, hooks, widgets, and shortcodes
 * @param  array $hooks_include
 * @return array
 */
function childfx_load_extension($files_included, $type)
{
    $allowed_types = array('helpers', 'hooks', 'widgets', 'shortcodes');
    if (!in_array($type, $allowed_types)) {
        return false;
    }
    $local_files = array();
    foreach (Calibrefx::glob_php(CHILD_URI . '/' . CHILD_APP_DIR . '/' . $type) as $file) {
        $local_files[] = $file;
    }
    return array_merge($files_included, $local_files);
}
 function load_widgets()
 {
     $widgets_include = apply_filters('calibrefx_widgets_to_include', Calibrefx::glob_php(CALIBREFX_WIDGET_URI), 'widgets');
     foreach ($widgets_include as $include) {
         include $include;
     }
 }