Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/13/2021 02:33:37 PM (3 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-templates/bp-nouveau/includes/functions.php

    r13144 r13145  
    44 *
    55 * @since 3.0.0
    6  * @version 9.0.0
     6 * @version 10.0.0
    77 */
    88
     
    16401640    return $widget_content;
    16411641}
     1642
     1643/**
     1644 * Retuns the theme layout available widths.
     1645 *
     1646 * @since 10.0.0
     1647 *
     1648 * @return array The available theme layout widths.
     1649 */
     1650function bp_nouveau_get_theme_layout_widths() {
     1651    $layout_widths = array();
     1652
     1653    if ( current_theme_supports( 'align-wide' ) ) {
     1654        $layout_widths = array(
     1655            'alignnone' => __( 'Default width', 'buddypress' ),
     1656            'alignwide' => __( 'Wide width', 'buddypress' ),
     1657            'alignfull' => __( 'Full width', 'buddypress' ),
     1658        );
     1659    }
     1660
     1661    // `wp_get_global_settings()` has been introduced in WordPress 5.9
     1662    if ( function_exists( 'wp_get_global_settings' ) ) {
     1663        $theme_layouts = wp_get_global_settings( array( 'layout' ) );
     1664
     1665        if ( isset( $theme_layouts['wideSize'] ) && $theme_layouts['wideSize'] ) {
     1666            $layout_widths = array(
     1667                'alignnone' => __( 'Content width', 'buddypress' ),
     1668                'alignwide' => __( 'Wide width', 'buddypress' ),
     1669            );
     1670        }
     1671    }
     1672
     1673    /**
     1674     * Filter here to edit the available theme layout widths.
     1675     *
     1676     * @since 10.0.0
     1677     *
     1678     * @param array $layout_widths The available theme layout widths.
     1679     */
     1680    return apply_filters( 'bp_nouveau_get_theme_layout_widths', $layout_widths );
     1681}
Note: See TracChangeset for help on using the changeset viewer.