Skip to:
Content

BuddyPress.org

Changeset 13867


Ignore:
Timestamp:
05/17/2024 05:08:14 AM (7 months ago)
Author:
imath
Message:

Stop getting dynamic widget block template parts, use buffer instead

Dynamic widget block template parts are used to preview and display the corresponding blocks content. As previewing within the Block Editor is made using the REST API, we need to add the rendered templates to the buffer to perform token replacements.

Props chairmanbrando

Fixes #9079
Closes https://github.com/buddypress/buddypress/pull/289

File:
1 edited

Legend:

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

    r13846 r13867  
    111111    $template_path = bp_locate_template( $template );
    112112    if ( $template_path ) {
    113         $template_string = file_get_contents( $template_path );
     113        ob_start();
     114        load_template( $template_path, false );
     115
     116        $template_string = ob_get_clean();
    114117    }
    115118
Note: See TracChangeset for help on using the changeset viewer.