Skip to:
Content

bbPress.org

Changeset 4820


Ignore:
Timestamp:
03/25/2013 08:38:00 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Introduce 'bbp_locate_template' action to bbp_locate_template(), with inline documentation for intended usage. Fixes #2277.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/core/template-functions.php

    r4763 r4820  
    6969
    7070        // Continue if template is empty
    71         if ( empty( $template_name ) )
     71        if ( empty( $template_name ) ) {
    7272            continue;
     73        }
    7374
    7475        // Trim off any slashes from the template name
     
    7980
    8081            // Continue if $template_location is empty
    81             if ( empty( $template_location ) )
     82            if ( empty( $template_location ) ) {
    8283                continue;
     84            }
    8385
    8486            // Check child theme first
     
    9092    }
    9193
     94    /**
     95     * This action exists only to follow the stardard bbPress coding convention,
     96     * and should not be used to short-circuit any part of the template locator.
     97     *
     98     * If you want to override a specific template part, please either filter
     99     * 'bbp_get_template_part' or add a new location to the template stack.
     100     */
     101    do_action( 'bbp_locate_template', $located, $template_name, $template_names, $template_locations, $load, $require_once );
     102
    92103    // Maybe load the template if one was located
    93     if ( ( true == $load ) && !empty( $located ) )
     104    if ( ( true == $load ) && !empty( $located ) ) {
    94105        load_template( $located, $require_once );
     106    }
    95107
    96108    return $located;
Note: See TracChangeset for help on using the changeset viewer.