Skip to:
Content

BuddyPress.org

Changeset 13692


Ignore:
Timestamp:
01/13/2024 09:45:16 AM (11 months ago)
Author:
imath
Message:

Make sure a random email is previewed when customizing BP Emails

[13689] introduced a side effect with the BP Email customization feature. Instead of showing a random Email it was showing the site’s home page when a BP Directory was set as the site's front page. This change is making sure a random BP Email will be previewed even if a BP Directory is the site's front page.

A deprecated notice with WordPress 6.4 has also been resolved and a warning notice has been reported upstream as, to our point of view, the WP Customizer shouldn't load the widgets component when a Block Theme is used for the site. See WP60236.

Props emaralive

See #9056 (trunk)
Closes https://github.com/buddypress/buddypress/pull/215

Location:
trunk/src
Files:
3 edited

Legend:

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

    r13689 r13692  
    19371937    $home_url      = home_url( '/' );
    19381938
    1939     if ( is_customize_preview() ) {
     1939    if ( is_customize_preview() && ! bp_is_email_customizer() ) {
    19401940        $requested_url = wp_parse_url( $requested_url, PHP_URL_PATH );
    19411941        $home_url      = wp_parse_url( $home_url, PHP_URL_PATH );
     
    37823782
    37833783/**
     3784 * Outputs the BP Email's template footer.
     3785 *
     3786 * @since 12.1.0
     3787 */
     3788function bp_email_footer() {
     3789    // `the_block_template_skip_link()` was deprecated in WP 6.4.0.
     3790    if ( bp_is_running_wp( '6.4.0', '>=' ) && has_action( 'wp_footer', 'the_block_template_skip_link' ) ) {
     3791        remove_action( 'wp_footer', 'the_block_template_skip_link' );
     3792    }
     3793
     3794    wp_footer();
     3795}
     3796
     3797/**
    37843798 * Checks if a Widget/Block is active.
    37853799 *
  • trunk/src/bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php

    r12566 r13692  
    241241    </center>
    242242</td></tr></table>
    243 <?php if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) wp_footer(); ?>
     243<?php if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) bp_email_footer(); ?>
    244244</body>
    245245</html>
  • trunk/src/bp-templates/bp-nouveau/buddypress/assets/emails/single-bp-email.php

    r12566 r13692  
    243243<?php
    244244if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) {
    245     wp_footer();
     245    bp_email_footer();
    246246}
    247247?>
Note: See TracChangeset for help on using the changeset viewer.