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

    r7378 r7379  
    571571        return;
    572572
    573     // Reply exists
     573    // Check users ability to create new reply
     574    } elseif ( ! bbp_is_reply_anonymous( $reply_id ) ) {
     575
     576        // User cannot edit this reply
     577        if ( ! current_user_can( 'edit_reply', $reply_id ) ) {
     578            bbp_add_error( 'bbp_edit_reply_permission', __( '<strong>Error</strong>: You do not have permission to edit that reply.', 'bbpress' ) );
     579            return;
     580        }
     581
     582        // Set reply author
     583        $reply_author = bbp_get_reply_author_id( $reply_id );
     584
     585    // It is an anonymous post
    574586    } else {
    575587
    576         // Check users ability to create new reply
    577         if ( ! bbp_is_reply_anonymous( $reply_id ) ) {
    578 
    579             // User cannot edit this reply
    580             if ( ! current_user_can( 'edit_reply', $reply_id ) ) {
    581                 bbp_add_error( 'bbp_edit_reply_permission', __( '<strong>Error</strong>: You do not have permission to edit that reply.', 'bbpress' ) );
    582                 return;
    583             }
    584 
    585             // Set reply author
    586             $reply_author = bbp_get_reply_author_id( $reply_id );
    587 
    588         // It is an anonymous post
    589         } else {
    590 
    591             // Filter anonymous data
    592             $anonymous_data = bbp_filter_anonymous_post_data();
    593         }
     588        // Filter anonymous data
     589        $anonymous_data = bbp_filter_anonymous_post_data();
    594590    }
    595591
     
    14001396            case 'topic' :
    14011397            default :
    1402 
    14031398                // User needs to be able to publish topics
    14041399                if ( current_user_can( 'publish_topics' ) ) {
     
    23202315
    23212316        <?php if ( bbp_has_replies( $replies_query ) ) : ?>
    2322             <?php while ( bbp_replies() ) : bbp_the_reply(); ?>
     2317            <?php while ( bbp_replies() ) :
     2318
     2319                bbp_the_reply(); ?>
    23232320
    23242321                <item>
Note: See TracChangeset for help on using the changeset viewer.