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/common/functions.php

    r7378 r7379  
    17171717 * @global WP $wp
    17181718 * @param string $where
    1719  * @param WP_Query $object
     1719 * @param WP_Query $query
    17201720 * @return string
    17211721 */
    1722 function bbp_query_post_parent__in( $where, $object = '' ) {
     1722function bbp_query_post_parent__in( $where, $query = '' ) {
    17231723    global $wp;
    17241724
     
    17291729
    17301730    // Bail if no object passed
    1731     if ( empty( $object ) ) {
     1731    if ( empty( $query ) ) {
    17321732        return $where;
    17331733    }
    17341734
    17351735    // Only 1 post_parent so return $where
    1736     if ( is_numeric( $object->query_vars['post_parent'] ) ) {
     1736    if ( is_numeric( $query->query_vars['post_parent'] ) ) {
    17371737        return $where;
    17381738    }
     
    17421742
    17431743    // Including specific post_parent's
    1744     if ( ! empty( $object->query_vars['post_parent__in'] ) ) {
    1745         $ids    = implode( ',', wp_parse_id_list( $object->query_vars['post_parent__in'] ) );
     1744    if ( ! empty( $query->query_vars['post_parent__in'] ) ) {
     1745        $ids    = implode( ',', wp_parse_id_list( $query->query_vars['post_parent__in'] ) );
    17461746        $where .= " AND {$bbp_db->posts}.post_parent IN ($ids)";
    17471747
    17481748    // Excluding specific post_parent's
    1749     } elseif ( ! empty( $object->query_vars['post_parent__not_in'] ) ) {
    1750         $ids    = implode( ',', wp_parse_id_list( $object->query_vars['post_parent__not_in'] ) );
     1749    } elseif ( ! empty( $query->query_vars['post_parent__not_in'] ) ) {
     1750        $ids    = implode( ',', wp_parse_id_list( $query->query_vars['post_parent__not_in'] ) );
    17511751        $where .= " AND {$bbp_db->posts}.post_parent NOT IN ($ids)";
    17521752    }
Note: See TracChangeset for help on using the changeset viewer.