bbp_buffer_template_part( string $slug, string $name = null, $echo = true )
Get a template part in an output buffer, and return it
Description
Parameters
- $slug
-
(Required)
- $name
-
(Optional)
Default value: null
Return
(string)
Source
File: bp-forums/core/template-functions.php
function bbp_buffer_template_part( $slug, $name = null, $echo = true ) {
ob_start();
bbp_get_template_part( $slug, $name );
// Get the output buffer contents
$output = ob_get_clean();
// Echo or return the output buffer contents
if ( true === $echo ) {
echo $output;
} else {
return $output;
}
}
Changelog
| Version | Description |
|---|---|
| bbPress (r5043) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.