Example #1
0
 static function load_theme_functions()
 {
     global $pagenow;
     // If bbPress is being deactivated, do not load any more files
     if (bbp_is_deactivation()) {
         return;
     }
     if (!defined('WP_INSTALLING') || !empty($pagenow) && 'wp-activate.php' !== $pagenow) {
         bbp_locate_template('bbpresskr-functions.php', true);
     }
 }
Example #2
0
/**
 * Retrieve path to a template
 *
 * Used to quickly retrieve the path of a template without including the file
 * extension. It will also check the parent theme and theme-compat theme with
 * the use of {@link bbp_locate_template()}. Allows for more generic template
 * locations without the use of the other get_*_template() functions.
 *
 * @since bbPress (r3629)
 *
 * @param string $type Filename without extension.
 * @param array $templates An optional list of template candidates
 * @uses bbp_set_theme_compat_templates()
 * @uses bbp_locate_template()
 * @uses bbp_set_theme_compat_template()
 * @return string Full path to file.
 */
function bbp_get_query_template($type, $templates = array())
{
    $type = preg_replace('|[^a-z0-9-]+|', '', $type);
    if (empty($templates)) {
        $templates = array("{$type}.php");
    }
    // Filter possible templates, try to match one, and set any bbPress theme
    // compat properties so they can be cross-checked later.
    $templates = apply_filters("bbp_get_{$type}_template", $templates);
    $templates = bbp_set_theme_compat_templates($templates);
    $template = bbp_locate_template($templates);
    $template = bbp_set_theme_compat_template($template);
    return apply_filters("bbp_{$type}_template", $template);
}
Example #3
0
/**
 * Attempt to load a custom bbPress functions file, similar to each themes
 * functions.php file.
 *
 * @since bbPress (r3732)
 *
 * @global string $pagenow
 * @uses bbp_locate_template()
 */
function bbp_load_theme_functions()
{
    global $pagenow;
    if (!defined('WP_INSTALLING') || !empty($pagenow) && 'wp-activate.php' !== $pagenow) {
        bbp_locate_template('bbpress-functions.php', true);
    }
}