Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/04/2024 02:30:49 AM (20 months ago)
Author:
espellcaste
Message:

WPCS: Part X: miscellaneous fixes for some of the files of the core component.

Follow-up to [13901]

See #9164 and #7228

File:
1 edited

Legend:

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

    r13878 r13903  
    186186
    187187        // Trim off any slashes from the template name.
    188         $template_name  = ltrim( $template_name, '/' );
     188        $template_name = ltrim( $template_name, '/' );
    189189
    190190        // Loop through template stack.
     
    253253
    254254    // Set up data array.
    255     $data = array();
     255    $data         = array();
    256256    $data['file'] = $data['uri'] = $located;
    257257
    258258    $find = array(
    259259        get_theme_root(),
    260         bp_get_theme_compat_dir()
     260        bp_get_theme_compat_dir(),
    261261    );
    262262
    263263    $replace = array(
    264264        get_theme_root_uri(),
    265         bp_get_theme_compat_url()
     265        bp_get_theme_compat_url(),
    266266    );
    267267
     
    340340
    341341    // Setup some default variables.
    342     $tag  = 'bp_template_stack';
    343     $args = $stack = array();
     342    $tag   = 'bp_template_stack';
     343    $args  = array();
     344    $stack = array();
    344345
    345346    // Add 'bp_template_stack' to the current filter array.
     
    384385     * @param array $stack Array of registered directories for template locations.
    385386     */
    386     return (array) apply_filters( 'bp_get_template_stack', $stack ) ;
     387    return (array) apply_filters( 'bp_get_template_stack', $stack );
    387388}
    388389
     
    397398 * @param string      $slug See {@link bp_get_template_part()}.
    398399 * @param string|null $name See {@link bp_get_template_part()}.
    399  * @param bool        $echo If true, template content will be echoed. If false,
     400 * @param bool        $ret If true, template content will be echoed. If false,
    400401 *                          returned. Default: true.
    401402 * @param array       $args See {@link bp_get_template_part()}.
    402403 * @return string|null If $echo, returns the template content.
    403404 */
    404 function bp_buffer_template_part( $slug, $name = null, $echo = true, $args = array() ) {
     405function bp_buffer_template_part( $slug, $name = null, $ret = true, $args = array() ) {
    405406    ob_start();
    406407
     
    417418
    418419    // Echo or return the output buffer contents.
    419     if ( true === $echo ) {
     420    if ( true === $ret ) {
    420421        // phpcs:ignore WordPress.Security.EscapeOutput
    421422        echo $output;
     
    500501        'buddypress',
    501502        'community',
    502         ''
     503        '',
    503504    );
    504505
     
    565566
    566567    // Bail if filters are suppressed on this query.
    567     if ( true == $posts_query->get( 'suppress_filters' ) ) {
     568    if ( true === $posts_query->get( 'suppress_filters' ) ) {
    568569        return;
    569570    }
     
    831832 */
    832833function bp_get_theme_compat_templates() {
    833     return bp_get_query_template( 'buddypress', array(
    834         'plugin-buddypress.php',
    835         'buddypress.php',
    836         'community.php',
    837         'generic.php',
    838         'page.php',
    839         'single.php',
    840         'singular.php',
    841         'index.php'
    842     ) );
     834    return bp_get_query_template(
     835        'buddypress',
     836        array(
     837            'plugin-buddypress.php',
     838            'buddypress.php',
     839            'community.php',
     840            'generic.php',
     841            'page.php',
     842            'single.php',
     843            'singular.php',
     844            'index.php',
     845        )
     846    );
    843847}
    844848
Note: See TracChangeset for help on using the changeset viewer.