Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/24/2019 01:38:37 PM (4 years ago)
Author:
netweb
Message:

Build Tools: Add PHPCS with custom bbPress ruleset

  • This changeset adds an initial bbPress PHPCS ruleset
  • Future iteration of the rules in the ruleset can follow later
  • To run the PHPCS check run `grunt phpcs

Fixes #3294.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/topics.php

    r6850 r7006  
    275275
    276276        $sendback = remove_query_arg( array( 'spam', 'unspam' ), $sendback );
    277         $updated = $locked = 0;
     277        $updated  = $locked = 0;
    278278
    279279        if ( 'spam' === $doaction ) {
     
    619619
    620620                $is_sticky = bbp_is_topic_sticky( $topic_id );
    621                 $is_super  = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] )
     621                $is_super  = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( '1' === $_GET['super'] )
    622622                    ? true
    623623                    : false;
     
    693693        // Bail if no topic_id or notice
    694694        $topic_id = bbp_get_topic_id( $_GET['topic_id'] );
    695         if (  empty( $topic_id ) ) {
     695        if ( empty( $topic_id ) ) {
    696696            return;
    697697        }
     
    10331033            if ( bbp_get_trash_status_id() === $topic->post_status ) {
    10341034                $post_type_object   = get_post_type_object( bbp_get_topic_post_type() );
    1035                 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ), 'untrash-post_' . $topic->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
     1035                $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ), 'untrash-post_' . $topic->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . '</a>';
    10361036            } elseif ( ! empty( $trash_days ) ) {
    1037                 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
     1037                $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . '</a>';
    10381038            }
    10391039
    10401040            if ( ( bbp_get_trash_status_id() === $topic->post_status ) || empty( $trash_days ) ) {
    1041                 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
     1041                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . '</a>';
    10421042            }
    10431043        }
     
    11681168        // Messages array
    11691169        $messages[ $this->post_type ] = array(
    1170             0 =>  '', // Left empty on purpose
     1170            0 => '', // Left empty on purpose
    11711171
    11721172            // Updated
    1173             1 =>  sprintf(
     1173            1 => sprintf(
    11741174                '%1$s <a href="%2$s">%3$s</a>',
    11751175                esc_html__( 'Topic updated.', 'bbpress' ),
Note: See TracChangeset for help on using the changeset viewer.