Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/13/2021 02:33:37 PM (2 years ago)
Author:
imath
Message:

WP FSE Compat: make sure BuddyPress templates are loaded on front-end

Adapt the BuddyPress Theme Compat API so that it uses the WordPress block template canvas when the active theme supports block templates. You can now test BuddyPress inside Twenty Twenty-Two: the next WordPress default theme!

Improves the BP Nouveau Template Pack introducing a new function bp_nouveau_get_theme_layout_widths() to get the theme layout available widths and use the wider one by default.

See #8474

File:
1 edited

Legend:

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

    r13002 r13145  
    454454    $templates = apply_filters( "bp_get_{$type}_template", $templates );
    455455
    456     // Filter possible templates, try to match one, and set any BuddyPress theme
    457     // compat properties so they can be cross-checked later.
     456    /*
     457     * Filter possible templates, try to match one, and set any BuddyPress theme
     458     * compat properties so they can be cross-checked later.
     459     */
    458460    $templates = bp_set_theme_compat_templates( $templates );
    459461    $template  = bp_locate_template( $templates );
    460     $template  = bp_set_theme_compat_template( $template );
     462
     463    /*
     464     * The current theme is using the WordPress Full Site Editing feature.
     465     * BuddyPress then needs to use the WordPress template canvas to retrieve the community content.
     466     */
     467    if ( current_theme_supports( 'block-templates' ) && $template === get_theme_file_path( 'index.php' ) ) {
     468        $template = ABSPATH . WPINC . '/template-canvas.php';
     469    }
     470
     471    $template = bp_set_theme_compat_template( $template );
    461472
    462473    /**
Note: See TracChangeset for help on using the changeset viewer.