Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/16/2025 10:43:01 PM (4 months ago)
Author:
johnjamesjacoby
Message:

Tools - Code Improvement: Updates to the phpcs.xml.dist config file.

This commit implements the WordPress.WP.I18n.MissingTranslatorsComment code sniff, fixes a bunch of whitespace regressions from #3614 and #3613.

Props johnjamesjacoby, sirlouen.

In trunk, for 2.7.

Fixes #3615.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/buddypress/groups.php

    r7357 r7360  
    484484                    <label for="bbp_group_forum_id"><?php esc_html_e( 'Group Forum:', 'bbpress' ); ?></label>
    485485                    <?php
    486                         bbp_dropdown( array(
    487                             'select_id' => 'bbp_group_forum_id',
    488                             'show_none' => esc_html__( '&mdash; No forum &mdash;', 'bbpress' ),
    489                             'selected'  => $forum_id
    490                         ) );
     486                        bbp_dropdown(
     487                            array(
     488                                'select_id' => 'bbp_group_forum_id',
     489                                'show_none' => esc_html__( '&mdash; No forum &mdash;', 'bbpress' ),
     490                                'selected'  => $forum_id
     491                            )
     492                        );
    491493                    ?>
    492494                    <p class="description"><?php esc_html_e( 'Network administrators can reconfigure which forum belongs to this group.', 'bbpress' ); ?></p>
     
    16931695    }
    16941696
    1695     /**
    1696     * Fixes rewrite pagination in BuddyPress Group Forums & Topics.
    1697      *
    1698     * Required for compatibility with BuddyPress > 12.0, where the /groups/
     1697    /**
     1698    * Fixes rewrite pagination in BuddyPress Group Forums & Topics.
     1699     *
     1700    * Required for compatibility with BuddyPress > 12.0, where the /groups/
    16991701     * rewrite rule will be caught before bbPress's /page/ rule.
    17001702     *
     
    17041706     * @param  string $type   Type of variable to check with `is_a()`
    17051707     * @return mixed  $object Verified object if valid, Default or null if invalid
    1706     */
    1707     public function rewrite_pagination( $object, $type = '' ) {
     1708    */
     1709    public function rewrite_pagination( $object, $type = '' ) {
    17081710
    17091711        // Bail if wrong global
    1710         if ( 'wp_query' !== $type ) {
    1711             return $object;
    1712         }
     1712        if ( 'wp_query' !== $type ) {
     1713            return $object;
     1714        }
    17131715
    17141716        // Bail if not inside a BuddyPress Group
    1715         if ( ! bp_is_group() ) {
    1716             return $object;
    1717         }
     1717        if ( ! bp_is_group() ) {
     1718            return $object;
     1719        }
    17181720
    17191721        // Bail if not inside a BuddyPress Group Forum
    1720         if ( ! bp_is_current_action( 'forum' ) ) {
    1721             return $object;
    1722         }
     1722        if ( ! bp_is_current_action( 'forum' ) ) {
     1723            return $object;
     1724        }
    17231725
    17241726        // Default "paged" value
    1725         $page_number = null;
    1726 
    1727         // Can't use bbp_is_single_topic() because it triggers a loop.
    1728         $is_single_topic = bp_is_action_variable( 'topic', 0 );
     1727        $page_number = null;
     1728
     1729        // Can't use bbp_is_single_topic() because it triggers a loop.
     1730        $is_single_topic = bp_is_action_variable( 'topic', 0 );
    17291731
    17301732        // Single Topic
    1731         if ( true === $is_single_topic ) {
     1733        if ( true === $is_single_topic ) {
    17321734
    17331735            // Get the page number from 3rd position
    1734             if ( bp_is_action_variable( 'page', 2 ) ) {
    1735                 $page_number = bp_action_variable( 3 );
    1736             }
     1736            if ( bp_is_action_variable( 'page', 2 ) ) {
     1737                $page_number = bp_action_variable( 3 );
     1738            }
    17371739
    17381740        // Single Forum
    1739         } else {
     1741        } else {
    17401742
    17411743            // Get the page number from 1st position
    1742             if ( bp_is_action_variable( 'page', 0 ) ) {
    1743                 $page_number = bp_action_variable( 1 );
    1744             }
    1745         }
     1744            if ( bp_is_action_variable( 'page', 0 ) ) {
     1745                $page_number = bp_action_variable( 1 );
     1746            }
     1747        }
    17461748
    17471749        // Bail if no page number
    1748         if ( empty( $page_number ) ) {
    1749             return $object;
    1750         }
     1750        if ( empty( $page_number ) ) {
     1751            return $object;
     1752        }
    17511753
    17521754        // Set the 'paged' WP_Query var to the new action-based value
    1753         $object->set( 'paged', $page_number );
     1755        $object->set( 'paged', $page_number );
    17541756
    17551757        // Return the filtered/modified object
    1756         return $object;
    1757     }
     1758        return $object;
     1759    }
    17581760
    17591761    /**
Note: See TracChangeset for help on using the changeset viewer.