Skip to:
Content

bbPress.org

Changeset 7425


Ignore:
Timestamp:
09/04/2026 09:28:44 AM (2 weeks ago)
Author:
johnjamesjacoby
Message:

Core - Theme Compat: backport corrected Block Theme support.\n\nUse the WordPress template canvas only for true Block Themes. Classic PHP themes that include theme.json continue loading their bbPress template.\n\nAdd the filterable canvas-template helper and regression coverage for classic, hybrid, Block, and child themes. This mirrors the BuddyPress correction for the same regression.\n\nIn branches/2.6, for 2.6.16.\n\nProps obenland.\nSee #3487.\nFixes #3675.\nSee https://buddypress.trac.wordpress.org/ticket/8757.

Location:
branches/2.6
Files:
24 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/core/template-loader.php

    r6573 r7425  
    471471        return bbp_get_query_template( 'bbpress', $templates );
    472472}
     473
     474/**
     475 * Get the theme canvas template, used for Block Themes.
     476 *
     477 * @since 2.6.16 bbPress
     478 *
     479 * @return string Path to canvas file.
     480 */
     481function bbp_get_theme_canvas_template() {
     482
     483        // Default WordPress Canvas
     484        $template = ABSPATH . WPINC . '/template-canvas.php';
     485
     486        // Filter & return
     487        return apply_filters( 'bbp_get_theme_canvas_template', $template );
     488}
  • branches/2.6/src/includes/core/theme-compat.php

    r7328 r7425  
    478478 *
    479479 * @since 2.0.0 bbPress (r3032)
     480 * @since 2.6.16 bbPress Added support for Block Themes
    480481 *
    481482 * @param string $template
     
    844845                bbp_remove_all_filters( 'the_content' );
    845846
    846                 $template = bbp_get_theme_compat_templates();
     847                // Block themes
     848                if ( wp_is_block_theme() ) {
     849                        $template = bbp_get_theme_canvas_template();
     850
     851                // Non-block themes
     852                } else {
     853                        $template = bbp_get_theme_compat_templates();
     854                }
    847855        }
    848856
Note: See TracChangeset for help on using the changeset viewer.