Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/08/2012 08:50:37 AM (12 years ago)
Author:
r-a-y
Message:

Theme Compat:

  • Introduce 'bp_locate_fallback_template' filter so 3rd-party plugin devs can load custom templates for their components if desired.
  • See #4546.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template-loader.php

    r6365 r6394  
    8888
    8989        // Check theme compatibility last
    90         } elseif ( file_exists( trailingslashit( $fallback_theme ) . $template_name ) ) {
    91             $located = trailingslashit( $fallback_theme ) . $template_name;
    92             break;
     90        } else {
     91            // 3rd-party plugin devs can hook into the 'bp_locate_fallback_template'
     92            // filter to load custom templates for their component if desired
     93            $fallback_template = apply_filters( 'bp_locate_fallback_template', trailingslashit( $fallback_theme ) . $template_name, $template_name );
     94
     95            if ( file_exists( $fallback_template ) ) {
     96                $located = $fallback_template;
     97                break;
     98            }
    9399        }
    94100    }
     
    189195 *
    190196 * @param array $templates
    191  * @return array() 
     197 * @return array()
    192198 */
    193199function bp_add_template_locations( $templates = array() ) {
     
    235241 * Listens to the 'template_include' filter and waits for any BuddyPress specific
    236242 * template condition to be met. If one is met and the template file exists,
    237  * it will be used; otherwise 
     243 * it will be used; otherwise
    238244 *
    239245 * Note that the _edit() checks are ahead of their counterparts, to prevent them
Note: See TracChangeset for help on using the changeset viewer.