Skip to:
Content

BuddyPress.org

Changeset 10879


Ignore:
Timestamp:
06/12/2016 07:14:43 PM (8 years ago)
Author:
r-a-y
Message:

Embeds: Add support for bp-default themes.

bp-default uses a brute-force approach to loading templates. For embed
templates to render, we must wipe out any located bp-default template when
an embed page is being requested.

This allows the WordPress embed template to load as expected when a
bp-default theme is currently active.

See #7115.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-catchuri.php

    r10825 r10879  
    457457     */
    458458    $located_template = apply_filters( 'bp_located_template', $template, $filtered_templates );
     459
     460    /*
     461     * If current page is an embed, wipe out bp-default template.
     462     *
     463     * Wiping out the bp-default template allows WordPress to use their special
     464     * embed template, which is what we want.
     465     */
     466    if ( function_exists( 'is_embed' ) && is_embed() ) {
     467        $located_template = '';
     468    }
     469
    459470    if ( !empty( $located_template ) ) {
    460471        // Template was located, lets set this as a valid page and not a 404.
Note: See TracChangeset for help on using the changeset viewer.