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

    r6923 r7006  
    647647
    648648        // Update counts, etc...
    649         do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic_author , true /* Is edit */ );
     649        do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic_author, true /* Is edit */ );
    650650
    651651        /** Revisions *********************************************************/
     
    661661
    662662        // Update revision log
    663         if ( ! empty( $_POST['bbp_log_topic_edit'] ) && ( "1" === $_POST['bbp_log_topic_edit'] ) ) {
     663        if ( ! empty( $_POST['bbp_log_topic_edit'] ) && ( '1' === $_POST['bbp_log_topic_edit'] ) ) {
    664664            $revision_id = wp_save_post_revision( $topic_id );
    665665            if ( ! empty( $revision_id ) ) {
     
    790790        }
    791791
     792    // If not anonymous, then
    792793    } else {
    793794        if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) {
     
    868869
    869870        // Get the forum ID if none was passed
    870         if ( empty( $forum_id )  ) {
     871        if ( empty( $forum_id ) ) {
    871872            $forum_id = bbp_get_topic_forum_id( $topic_id );
    872873        }
     
    11951196
    11961197        // Shift the tags if told to
    1197         if ( ! empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) ) {
     1198        if ( ! empty( $_POST['bbp_topic_tags'] ) && ( '1' === $_POST['bbp_topic_tags'] ) ) {
    11981199            wp_set_post_terms( $destination_topic->ID, $source_topic_tags, bbp_get_topic_tag_tax_id(), true );
    11991200        }
     
    14881489
    14891490    // Copy the subscribers
    1490     if ( ! empty( $_POST['bbp_topic_subscribers'] ) && "1" === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
     1491    if ( ! empty( $_POST['bbp_topic_subscribers'] ) && '1' === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
    14911492
    14921493        // Get the subscribers
     
    15051506
    15061507    // Copy the favoriters if told to
    1507     if ( ! empty( $_POST['bbp_topic_favoriters'] ) && ( "1" === $_POST['bbp_topic_favoriters'] ) ) {
     1508    if ( ! empty( $_POST['bbp_topic_favoriters'] ) && ( '1' === $_POST['bbp_topic_favoriters'] ) ) {
    15081509
    15091510        // Get the favoriters
     
    15221523
    15231524    // Copy the tags if told to
    1524     if ( ! empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) ) {
     1525    if ( ! empty( $_POST['bbp_topic_tags'] ) && ( '1' === $_POST['bbp_topic_tags'] ) ) {
    15251526
    15261527        // Get the source topic tags
     
    21352136
    21362137            $is_sticky = bbp_is_topic_sticky( $r['id'] );
    2137             $is_super  = false === $is_sticky && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false;
     2138            $is_super  = false === $is_sticky && ! empty( $_GET['super'] ) && ( '1' === $_GET['super'] ) ? true : false;
    21382139
    21392140            // Toggle
     
    37763777        <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    37773778        <link><?php self_link(); ?></link>
    3778         <description><?php //?></description>
     3779        <description><?php //?></description><?php // phpcs:ignore ?>
    37793780        <lastBuildDate><?php echo date( 'r' ); ?></lastBuildDate>
    37803781        <generator><?php echo esc_url_raw( 'https://bbpress.org/?v=' . convert_chars( bbp_get_version() ) ); ?></generator>
     
    37923793                    <link><?php bbp_topic_permalink(); ?></link>
    37933794                    <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_meta( bbp_get_topic_id(), '_bbp_last_active_time', true ), false ); ?></pubDate>
    3794                     <dc:creator><?php the_author() ?></dc:creator>
     3795                    <dc:creator><?php the_author(); ?></dc:creator>
    37953796
    37963797                    <?php if ( !post_password_required() ) : ?>
Note: See TracChangeset for help on using the changeset viewer.