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/topics/template.php

    r7378 r7379  
    33163316                $r['selected'] = sanitize_key( $_POST[ $r['select_id'] ] );
    33173317
    3318             // No Post value passed
    3319             } else {
    3320 
    3321                 // Edit topic
    3322                 if ( bbp_is_single_topic() || bbp_is_topic_edit() ) {
    3323 
    3324                     // Get current topic id
    3325                     $r['topic_id'] = bbp_get_topic_id( $r['topic_id'] );
    3326 
    3327                     // Topic is super sticky
    3328                     if ( bbp_is_topic_super_sticky( $r['topic_id'] ) ) {
    3329                         $r['selected'] = 'super';
    3330 
    3331                     // Topic is sticky or normal
    3332                     } else {
    3333                         $r['selected'] = bbp_is_topic_sticky( $r['topic_id'], false )
    3334                             ? 'stick'
    3335                             : 'unstick';
    3336                     }
     3318            // Edit topic
     3319            } elseif ( bbp_is_single_topic() || bbp_is_topic_edit() ) {
     3320
     3321                // Get current topic id
     3322                $r['topic_id'] = bbp_get_topic_id( $r['topic_id'] );
     3323
     3324                // Topic is super sticky
     3325                if ( bbp_is_topic_super_sticky( $r['topic_id'] ) ) {
     3326                    $r['selected'] = 'super';
     3327
     3328                // Topic is sticky or normal
     3329                } else {
     3330                    $r['selected'] = bbp_is_topic_sticky( $r['topic_id'], false )
     3331                        ? 'stick'
     3332                        : 'unstick';
    33373333                }
    33383334            }
     
    34093405                $r['selected'] = sanitize_key( $_POST[ $r['select_id'] ] );
    34103406
    3411             // No Post value was passed
     3407            // Edit topic
     3408            } elseif ( bbp_is_topic_edit() ) {
     3409                $r['topic_id'] = bbp_get_topic_id( $r['topic_id'] );
     3410                $r['selected'] = bbp_get_topic_status( $r['topic_id'] );
     3411
     3412            // New topic
    34123413            } else {
    3413 
    3414                 // Edit topic
    3415                 if ( bbp_is_topic_edit() ) {
    3416                     $r['topic_id'] = bbp_get_topic_id( $r['topic_id'] );
    3417                     $r['selected'] = bbp_get_topic_status( $r['topic_id'] );
    3418 
    3419                 // New topic
    3420                 } else {
    3421                     $r['selected'] = bbp_get_public_status_id();
    3422                 }
     3414                $r['selected'] = bbp_get_public_status_id();
    34233415            }
    34243416        }
Note: See TracChangeset for help on using the changeset viewer.