Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/24/2025 07:23:06 PM (6 months ago)
Author:
johnjamesjacoby
Message:

Tools - Code Improvement: stop ignoring these PHPCS sniffs:

  • PEAR.Files.IncludingFile.UseRequire
  • PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLineDEFAULT
  • PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose
  • Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace
  • Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
  • Squiz.PHP.EmbeddedPhp.MultipleStatements
  • Squiz.PHP.NonExecutableCode.Unreachable
  • Universal.Arrays.DuplicateArrayKey.Found
  • Universal.ControlStructures.DisallowLonelyIf.Found
  • WordPress.PHP.NoSilencedErrors.Discouraged

This commit includes code formatting changes for the above sniffs.

See #3658.

File:
1 edited

Legend:

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

    r7378 r7379  
    17321732     * @since 2.6.14
    17331733     *
    1734      * @param  object object  Verified object
    1735      * @param  string $type   Type of variable to check with `is_a()`
    1736      * @return mixed  $object Verified object if valid, Default or null if invalid
    1737      */
    1738     public function rewrite_pagination( $object, $type = '' ) {
     1734     * @param  object $query  Verified query object
     1735     * @param  string $type   Type of variable to compare to
     1736     * @return mixed  Verified object if valid, Default or null if invalid
     1737     */
     1738    public function rewrite_pagination( $query, $type = '' ) {
    17391739
    17401740        // Bail if wrong global
    17411741        if ( 'wp_query' !== $type ) {
    1742             return $object;
     1742            return $query;
    17431743        }
    17441744
    17451745        // Bail if not inside a BuddyPress Group
    17461746        if ( ! bp_is_group() ) {
    1747             return $object;
     1747            return $query;
    17481748        }
    17491749
    17501750        // Bail if not inside a BuddyPress Group Forum
    17511751        if ( ! bp_is_current_action( 'forum' ) ) {
    1752             return $object;
     1752            return $query;
    17531753        }
    17541754
     
    17671767            }
    17681768
    1769         // Single Forum
    1770         } else {
    1771 
    1772             // Get the page number from 1st position
    1773             if ( bp_is_action_variable( 'page', 0 ) ) {
    1774                 $page_number = bp_action_variable( 1 );
    1775             }
     1769        // Default (Single Forum)
     1770        } elseif ( bp_is_action_variable( 'page', 0 ) ) {
     1771            $page_number = bp_action_variable( 1 );
    17761772        }
    17771773
    17781774        // Bail if no page number
    17791775        if ( empty( $page_number ) ) {
    1780             return $object;
     1776            return $query;
    17811777        }
    17821778
    17831779        // Set the 'paged' WP_Query var to the new action-based value
    1784         $object->set( 'paged', $page_number );
     1780        $query->set( 'paged', $page_number );
    17851781
    17861782        // Return the filtered/modified object
    1787         return $object;
     1783        return $query;
    17881784    }
    17891785
Note: See TracChangeset for help on using the changeset viewer.