Skip to:
Content

BuddyPress.org

Ticket #4755: template_stack.01.patch

File template_stack.01.patch, 1.5 KB (added by r-a-y, 11 years ago)
  • bp-core/bp-core-filters.php

    add_filter( 'bp_core_render_message_content', 'shortcode_unautop' ); 
    6161add_filter( 'bp_template_include', 'bp_template_include_theme_supports', 2, 1 );
    6262add_filter( 'bp_template_include', 'bp_template_include_theme_compat',   4, 2 );
    6363
    64 // Run all template parts through additional template locations
    65 add_filter( 'bp_locate_template',   'bp_add_template_locations' );
    66 add_filter( 'bp_get_template_part', 'bp_add_template_locations' );
     64/**
     65 * Adds custom locations as set in {@link bp_get_template_locations()} to
     66 * BuddyPress' template stack.
     67 *
     68 * @since BuddyPress (1.7)
     69 *
     70 * @uses bp_get_template_locations() Get the possible subdirectories to check for templates in
     71 * @return array All possible locations a template can reside in
     72 */
     73function bp_template_stack_add_custom_locations( $stacks ) {
     74        $locations = array();
     75       
     76        foreach ( $stacks as $stack ) {
     77                // for each stack, add our custom location
     78                foreach ( bp_get_template_locations() as $custom_location ) {
     79                        $locations[] = untrailingslashit( trailingslashit( $stack ) . $custom_location );
     80                }
     81        }
     82       
     83        return $locations;
     84}
     85add_filter( 'bp_get_template_stack', 'bp_template_stack_add_custom_locations' );
    6786
    6887// Turn comments off for BuddyPress pages
    6988add_filter( 'comments_open', 'bp_comments_open', 10, 2 );