Skip to:
Content

bbPress.org

Changeset 4995


Ignore:
Timestamp:
06/23/2013 06:37:22 AM (11 years ago)
Author:
johnjamesjacoby
Message:

Use strict comparisons where possible (excluding the converter code, as it needs dedicated testing.) See #2358.

Location:
trunk
Files:
36 edited

Legend:

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

    r4969 r4995  
    485485
    486486        // Return normal links if not bbPress
    487         if ( plugin_basename( bbpress()->file ) != $file )
     487        if ( plugin_basename( bbpress()->file ) !== $file )
    488488            return $links;
    489489
     
    558558        $reply_class = sanitize_html_class( bbp_get_reply_post_type() );
    559559
    560         if ( ( 'post' == get_current_screen()->base ) && ( bbp_get_reply_post_type() == get_current_screen()->post_type ) ) : ?>
     560        if ( ( 'post' === get_current_screen()->base ) && ( bbp_get_reply_post_type() === get_current_screen()->post_type ) ) : ?>
    561561
    562562        <script type="text/javascript">
     
    828828            }
    829829
    830             <?php if ( 'bbpress' == get_user_option( 'admin_color' ) ) : ?>
     830            <?php if ( 'bbpress' === get_user_option( 'admin_color' ) ) : ?>
    831831
    832832                /* Green Scheme Images */
  • trunk/includes/admin/metaboxes.php

    r4950 r4995  
    154154                        $text = _n( 'Hidden Topic', 'Hidden Topics', $r['topic_count_hidden'], 'bbpress' );
    155155                        $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
    156                         if ( '0' != $num ) {
     156                        if ( '0' !== $num ) {
    157157                            $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
    158158                        }
     
    176176                        $text = _n( 'Hidden Reply', 'Hidden Replies', $r['reply_count_hidden'], 'bbpress' );
    177177                        $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
    178                         if ( '0' != $num ) {
     178                        if ( '0' !== $num ) {
    179179                            $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
    180180                        }
  • trunk/includes/admin/replies.php

    r4991 r4995  
    9999     */
    100100    private function bail() {
    101         if ( !isset( get_current_screen()->post_type ) || ( $this->post_type != get_current_screen()->post_type ) )
     101        if ( !isset( get_current_screen()->post_type ) || ( $this->post_type !== get_current_screen()->post_type ) )
    102102            return true;
    103103
     
    339339
    340340        // Bail if post_type is not a reply
    341         if ( empty( $_GET['action'] ) || ( 'edit' != $_GET['action'] ) )
     341        if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) )
    342342            return;
    343343
     
    478478            $message = array( 'bbp_reply_toggle_notice' => $message, 'reply_id' => $reply->ID );
    479479
    480             if ( false == $success || is_wp_error( $success ) )
     480            if ( false === $success || is_wp_error( $success ) )
    481481                $message['failed'] = '1';
    482482
     
    530530            switch ( $notice ) {
    531531                case 'spammed' :
    532                     $message = $is_failure == true ? sprintf( __( 'There was a problem marking the reply "%1$s" as spam.', 'bbpress' ), $reply_title ) : sprintf( __( 'Reply "%1$s" successfully marked as spam.', 'bbpress' ), $reply_title );
     532                    $message = $is_failure === true ? sprintf( __( 'There was a problem marking the reply "%1$s" as spam.', 'bbpress' ), $reply_title ) : sprintf( __( 'Reply "%1$s" successfully marked as spam.', 'bbpress' ), $reply_title );
    533533                    break;
    534534
    535535                case 'unspammed' :
    536                     $message = $is_failure == true ? sprintf( __( 'There was a problem unmarking the reply "%1$s" as spam.', 'bbpress' ), $reply_title ) : sprintf( __( 'Reply "%1$s" successfully unmarked as spam.', 'bbpress' ), $reply_title );
     536                    $message = $is_failure === true ? sprintf( __( 'There was a problem unmarking the reply "%1$s" as spam.', 'bbpress' ), $reply_title ) : sprintf( __( 'Reply "%1$s" successfully unmarked as spam.', 'bbpress' ), $reply_title );
    537537                    break;
    538538            }
     
    543543            ?>
    544544
    545             <div id="message" class="<?php echo $is_failure == true ? 'error' : 'updated'; ?> fade">
     545            <div id="message" class="<?php echo $is_failure === true ? 'error' : 'updated'; ?> fade">
    546546                <p style="line-height: 150%"><?php echo esc_html( $message ); ?></p>
    547547            </div>
     
    654654
    655655                    // Alert capable users of reply forum mismatch
    656                     if ( $reply_forum_id != $topic_forum_id ) {
     656                    if ( $reply_forum_id !== $topic_forum_id ) {
    657657                        if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) {
    658658                            $forum_title .= '<div class="attention">' . esc_html__( '(Mismatch)', 'bbpress' ) . '</div>';
     
    727727
    728728        // User cannot view replies in trash
    729         if ( ( bbp_get_trash_status_id() == $reply->post_status ) && !current_user_can( 'view_trash' ) )
     729        if ( ( bbp_get_trash_status_id() === $reply->post_status ) && !current_user_can( 'view_trash' ) )
    730730            unset( $actions['view'] );
    731731
     
    744744        // Trash
    745745        if ( current_user_can( 'delete_reply', $reply->ID ) ) {
    746             if ( bbp_get_trash_status_id() == $reply->post_status ) {
     746            if ( bbp_get_trash_status_id() === $reply->post_status ) {
    747747                $post_type_object   = get_post_type_object( bbp_get_reply_post_type() );
    748748                $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
     
    751751            }
    752752
    753             if ( bbp_get_trash_status_id() == $reply->post_status || !EMPTY_TRASH_DAYS ) {
     753            if ( bbp_get_trash_status_id() === $reply->post_status || !EMPTY_TRASH_DAYS ) {
    754754                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
    755             } elseif ( bbp_get_spam_status_id() == $reply->post_status ) {
     755            } elseif ( bbp_get_spam_status_id() === $reply->post_status ) {
    756756                unset( $actions['trash'] );
    757757            }
     
    776776
    777777        // Add Empty Spam button
    778         if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() == $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
     778        if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
    779779            wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
    780780            $title = esc_attr__( 'Empty Spam', 'bbpress' );
  • trunk/includes/admin/settings.php

    r4971 r4995  
    17491749
    17501750        // Compare
    1751         if ( ( $slug != $key ) && ( $slug_check == $this_slug ) ) : ?>
     1751        if ( ( $slug !== $key ) && ( $slug_check === $this_slug ) ) : ?>
    17521752
    17531753            <span class="attention"><?php printf( esc_html__( 'Possible %1$s conflict: %2$s', 'bbpress' ), $value['context'], '<strong>' . $value['name'] . '</strong>' ); ?></span>
  • trunk/includes/admin/tools.php

    r4950 r4995  
    9191
    9292    foreach ( (array) bbp_admin_repair_list() as $item ) {
    93         if ( isset( $item[2] ) && isset( $_POST[$item[0]] ) && 1 == $_POST[$item[0]] && is_callable( $item[2] ) ) {
     93        if ( isset( $item[2] ) && isset( $_POST[$item[0]] ) && 1 === $_POST[$item[0]] && is_callable( $item[2] ) ) {
    9494            $messages[] = call_user_func( $item[2] );
    9595        }
     
    402402
    403403        // Rename 'Default Forum'  since it's now visible in sitewide forums
    404         if ( 'Default Forum' == $posts[0]->post_title ) {
     404        if ( 'Default Forum' === $posts[0]->post_title ) {
    405405            wp_update_post( array(
    406406                'ID'         => $posts[0]->ID,
     
    910910            // If the topic is not a super sticky, and the forum ID does not
    911911            // match the topic's forum ID, unset the forum's sticky meta.
    912             if ( ! bbp_is_topic_super_sticky( $topic_id ) && $forum_id != bbp_get_topic_forum_id( $topic_id ) ) {
     912            if ( ! bbp_is_topic_super_sticky( $topic_id ) && $forum_id !== bbp_get_topic_forum_id( $topic_id ) ) {
    913913                unset( $forum_stickies[$forum_id][$id] );
    914914            }
     
    12061206    $statement  = __( 'Deleting Conversion Table&hellip; %s', 'bbpress' );
    12071207    $table_name = $wpdb->prefix . 'bbp_converter_translator';
    1208     if ( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name ) {
     1208    if ( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) === $table_name ) {
    12091209        $wpdb->query( "DROP TABLE {$table_name}" );
    12101210        $result = $success;
  • trunk/includes/admin/topics.php

    r4991 r4995  
    9999     */
    100100    private function bail() {
    101         if ( !isset( get_current_screen()->post_type ) || ( $this->post_type != get_current_screen()->post_type ) )
     101        if ( !isset( get_current_screen()->post_type ) || ( $this->post_type !== get_current_screen()->post_type ) )
    102102            return true;
    103103
     
    355355
    356356        // Bail if post_type is not a topic
    357         if ( empty( $_GET['action'] ) || ( 'edit' != $_GET['action'] ) )
     357        if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) )
    358358            return;
    359359
     
    493493
    494494                    $is_open = bbp_is_topic_open( $topic_id );
    495                     $message = true == $is_open ? 'closed' : 'opened';
    496                     $success = true == $is_open ? bbp_close_topic( $topic_id ) : bbp_open_topic( $topic_id );
     495                    $message = true === $is_open ? 'closed' : 'opened';
     496                    $success = true === $is_open ? bbp_close_topic( $topic_id ) : bbp_open_topic( $topic_id );
    497497
    498498                    break;
     
    502502
    503503                    $is_sticky = bbp_is_topic_sticky( $topic_id );
    504                     $is_super  = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && 1 == (int) $_GET['super'] ) ? true : false;
    505                     $message   = true == $is_sticky ? 'unsticked'     : 'sticked';
    506                     $message   = true == $is_super  ? 'super_sticked' : $message;
    507                     $success   = true == $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
     504                    $is_super  = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && 1 === (int) $_GET['super'] ) ? true : false;
     505                    $message   = true === $is_sticky ? 'unsticked'     : 'sticked';
     506                    $message   = true === $is_super  ? 'super_sticked' : $message;
     507                    $success   = true === $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
    508508
    509509                    break;
     
    513513
    514514                    $is_spam = bbp_is_topic_spam( $topic_id );
    515                     $message = true == $is_spam ? 'unspammed' : 'spammed';
    516                     $success = true == $is_spam ? bbp_unspam_topic( $topic_id ) : bbp_spam_topic( $topic_id );
     515                    $message = true === $is_spam ? 'unspammed' : 'spammed';
     516                    $success = true === $is_spam ? bbp_unspam_topic( $topic_id ) : bbp_spam_topic( $topic_id );
    517517
    518518                    break;
     
    521521            $message = array( 'bbp_topic_toggle_notice' => $message, 'topic_id' => $topic->ID );
    522522
    523             if ( false == $success || is_wp_error( $success ) )
     523            if ( false === $success || is_wp_error( $success ) )
    524524                $message['failed'] = '1';
    525525
     
    573573            switch ( $notice ) {
    574574                case 'opened'    :
    575                     $message = $is_failure == true ? sprintf( __( 'There was a problem opening the topic "%1$s".',           'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully opened.',           'bbpress' ), $topic_title );
     575                    $message = $is_failure === true ? sprintf( __( 'There was a problem opening the topic "%1$s".',           'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully opened.',           'bbpress' ), $topic_title );
    576576                    break;
    577577
    578578                case 'closed'    :
    579                     $message = $is_failure == true ? sprintf( __( 'There was a problem closing the topic "%1$s".',           'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully closed.',           'bbpress' ), $topic_title );
     579                    $message = $is_failure === true ? sprintf( __( 'There was a problem closing the topic "%1$s".',           'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully closed.',           'bbpress' ), $topic_title );
    580580                    break;
    581581
    582582                case 'super_sticked' :
    583                     $message = $is_failure == true ? sprintf( __( 'There was a problem sticking the topic "%1$s" to front.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully sticked to front.', 'bbpress' ), $topic_title );
     583                    $message = $is_failure === true ? sprintf( __( 'There was a problem sticking the topic "%1$s" to front.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully sticked to front.', 'bbpress' ), $topic_title );
    584584                    break;
    585585
    586586                case 'sticked'   :
    587                     $message = $is_failure == true ? sprintf( __( 'There was a problem sticking the topic "%1$s".',          'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully sticked.',          'bbpress' ), $topic_title );
     587                    $message = $is_failure === true ? sprintf( __( 'There was a problem sticking the topic "%1$s".',          'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully sticked.',          'bbpress' ), $topic_title );
    588588                    break;
    589589
    590590                case 'unsticked' :
    591                     $message = $is_failure == true ? sprintf( __( 'There was a problem unsticking the topic "%1$s".',        'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unsticked.',        'bbpress' ), $topic_title );
     591                    $message = $is_failure === true ? sprintf( __( 'There was a problem unsticking the topic "%1$s".',        'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unsticked.',        'bbpress' ), $topic_title );
    592592                    break;
    593593
    594594                case 'spammed'   :
    595                     $message = $is_failure == true ? sprintf( __( 'There was a problem marking the topic "%1$s" as spam.',   'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully marked as spam.',   'bbpress' ), $topic_title );
     595                    $message = $is_failure === true ? sprintf( __( 'There was a problem marking the topic "%1$s" as spam.',   'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully marked as spam.',   'bbpress' ), $topic_title );
    596596                    break;
    597597
    598598                case 'unspammed' :
    599                     $message = $is_failure == true ? sprintf( __( 'There was a problem unmarking the topic "%1$s" as spam.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unmarked as spam.', 'bbpress' ), $topic_title );
     599                    $message = $is_failure === true ? sprintf( __( 'There was a problem unmarking the topic "%1$s" as spam.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unmarked as spam.', 'bbpress' ), $topic_title );
    600600                    break;
    601601            }
     
    606606            ?>
    607607
    608             <div id="message" class="<?php echo $is_failure == true ? 'error' : 'updated'; ?> fade">
     608            <div id="message" class="<?php echo $is_failure === true ? 'error' : 'updated'; ?> fade">
    609609                <p style="line-height: 150%"><?php echo esc_html( $message ); ?></p>
    610610            </div>
     
    774774
    775775        // Show view link if it's not set, the topic is trashed and the user can view trashed topics
    776         if ( empty( $actions['view'] ) && ( bbp_get_trash_status_id() == $topic->post_status ) && current_user_can( 'view_trash' ) )
     776        if ( empty( $actions['view'] ) && ( bbp_get_trash_status_id() === $topic->post_status ) && current_user_can( 'view_trash' ) )
    777777            $actions['view'] = '<a href="' . bbp_get_topic_permalink( $topic->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_topic_title( $topic->ID ) ) ) . '" rel="permalink">' . esc_html__( 'View', 'bbpress' ) . '</a>';
    778778
     
    814814        // Do not show trash links for spam topics, or spam links for trashed topics
    815815        if ( current_user_can( 'delete_topic', $topic->ID ) ) {
    816             if ( bbp_get_trash_status_id() == $topic->post_status ) {
     816            if ( bbp_get_trash_status_id() === $topic->post_status ) {
    817817                $post_type_object   = get_post_type_object( bbp_get_topic_post_type() );
    818818                $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . wp_nonce_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
     
    821821            }
    822822
    823             if ( bbp_get_trash_status_id() == $topic->post_status || !EMPTY_TRASH_DAYS ) {
     823            if ( bbp_get_trash_status_id() === $topic->post_status || !EMPTY_TRASH_DAYS ) {
    824824                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
    825             } elseif ( bbp_get_spam_status_id() == $topic->post_status ) {
     825            } elseif ( bbp_get_spam_status_id() === $topic->post_status ) {
    826826                unset( $actions['trash'] );
    827827            }
     
    846846
    847847        // Add Empty Spam button
    848         if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() == $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
     848        if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
    849849            wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
    850850            $title = esc_attr__( 'Empty Spam', 'bbpress' );
  • trunk/includes/admin/users.php

    r4950 r4995  
    182182
    183183            // Don't let a user change their own role
    184             if ( $user_id == $current_user_id )
     184            if ( $user_id === $current_user_id )
    185185                continue;
    186186
     
    194194
    195195            // Set the new forums role
    196             if ( $new_role != $user_role ) {
     196            if ( $new_role !== $user_role ) {
    197197                bbp_set_user_role( $user_id, $new_role );
    198198            }
     
    230230
    231231        // Only looking for bbPress's user role column
    232         if ( 'bbp_user_role' == $column_name ) {
     232        if ( 'bbp_user_role' === $column_name ) {
    233233
    234234            // Get the users role
  • trunk/includes/common/classes.php

    r4944 r4995  
    242242        // - the forum is a category
    243243        // - forum is closed
    244         if (    ( true == $args['disable_categories'] )
    245                 && ( bbp_get_forum_post_type() == $_post->post_type )
     244        if (    ( true === $args['disable_categories'] )
     245                && ( bbp_get_forum_post_type() === $_post->post_type )
    246246                && ( bbp_is_forum_category( $_post->ID )
    247247                    || ( !current_user_can( 'edit_forum', $_post->ID ) && bbp_is_forum_closed( $_post->ID )
  • trunk/includes/common/formatting.php

    r4942 r4995  
    187187
    188188    // Trim inline code, not pre blocks (to prevent removing indentation)
    189     if ( "`" == $matches[1] ) {
     189    if ( "`" === $matches[1] ) {
    190190        $content = trim( $matches[2] );
    191191    } else {
     
    205205
    206206    // Wrap blocks in pre tags
    207     if ( "`" != $matches[1] ) {
     207    if ( "`" !== $matches[1] ) {
    208208        $content = '<pre>' . $content . '</pre>';
    209209    }
     
    333333        }
    334334
    335         if ( $in_code || empty( $piece ) || ( $piece[0] == '<' && ! preg_match('|^<\s*[\w]{1,20}+://|', $piece) ) ) {
     335        if ( $in_code || empty( $piece ) || ( $piece[0] === '<' && ! preg_match('|^<\s*[\w]{1,20}+://|', $piece) ) ) {
    336336            $r .= $piece;
    337337            continue;
  • trunk/includes/common/functions.php

    r4916 r4995  
    153153                // Finding the biggest chunk (if the chunk fits, break)
    154154                $count = floor( $since / $seconds );
    155                 if ( 0 != $count ) {
     155                if ( 0 !== $count ) {
    156156                    break;
    157157                }
     
    165165
    166166                // Set output var
    167                 $output = ( 1 == $count ) ? '1 '. $chunks[$i][1] : $count . ' ' . $chunks[$i][2];
     167                $output = ( 1 === $count ) ? '1 '. $chunks[$i][1] : $count . ' ' . $chunks[$i][2];
    168168
    169169                // Step two: the second chunk
     
    174174
    175175                    // Add to output var
    176                     if ( 0 != $count2 ) {
    177                         $output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'bbpress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'bbpress' ) . ' ' . $count2 . ' ' . $chunks[$i + 1][2];
     176                    if ( 0 !== $count2 ) {
     177                        $output .= ( 1 === $count2 ) ? _x( ',', 'Separator in time since', 'bbpress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'bbpress' ) . ' ' . $count2 . ' ' . $chunks[$i + 1][2];
    178178                    }
    179179                }
     
    187187
    188188        // Append 'ago' to the end of time-since if not 'right now'
    189         if ( $output != $right_now_text ) {
     189        if ( $output !== $right_now_text ) {
    190190            $output = sprintf( $ago_text, $output );
    191191        }
     
    218218
    219219    // We add our own full stop.
    220     while ( substr( $reason, -1 ) == '.' )
     220    while ( substr( $reason, -1 ) === '.' )
    221221        $reason = substr( $reason, 0, -1 );
    222222
     
    291291 */
    292292function bbp_get_view_all( $cap = 'moderate' ) {
    293     $retval = ( ( !empty( $_GET['view'] ) && ( 'all' == $_GET['view'] ) && current_user_can( $cap ) ) );
     293    $retval = ( ( !empty( $_GET['view'] ) && ( 'all' === $_GET['view'] ) && current_user_can( $cap ) ) );
    294294    return apply_filters( 'bbp_get_view_all', (bool) $retval );
    295295}
     
    351351
    352352    // Is the post by an anonymous user?
    353     if ( ( bbp_get_topic_post_type() == $data['post_type'] && !bbp_is_topic_anonymous( $postarr['ID'] ) ) ||
    354          ( bbp_get_reply_post_type() == $data['post_type'] && !bbp_is_reply_anonymous( $postarr['ID'] ) ) )
     353    if ( ( bbp_get_topic_post_type() === $data['post_type'] && !bbp_is_topic_anonymous( $postarr['ID'] ) ) ||
     354         ( bbp_get_reply_post_type() === $data['post_type'] && !bbp_is_reply_anonymous( $postarr['ID'] ) ) )
    355355        return $data;
    356356
     
    10621062
    10631063        // Don't send notifications to the person who made the post
    1064         if ( !empty( $reply_author ) && (int) $user_id == (int) $reply_author )
     1064        if ( !empty( $reply_author ) && (int) $user_id === (int) $reply_author )
    10651065            continue;
    10661066
     
    11241124
    11251125        // Rejig the $redirect_to
    1126         if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( $redirect_to != home_url( $_SERVER['REDIRECT_URL'] ) ) ) {
     1126        if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( $redirect_to !== home_url( $_SERVER['REDIRECT_URL'] ) ) ) {
    11271127            $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '';
    11281128        }
     
    12571257
    12581258        // Add closed status if topic post type
    1259         if ( $post_type == bbp_get_topic_post_type() ) {
     1259        if ( $post_type === bbp_get_topic_post_type() ) {
    12601260            $post_status[] = bbp_get_closed_status_id();
    12611261        }
     
    13021302
    13031303        // Add closed status if topic post type
    1304         if ( $post_type == bbp_get_topic_post_type() ) {
     1304        if ( $post_type === bbp_get_topic_post_type() ) {
    13051305            $post_status[] = bbp_get_closed_status_id();
    13061306        }
     
    13471347
    13481348        // Add closed status if topic post type
    1349         if ( $post_type == bbp_get_topic_post_type() ) {
     1349        if ( $post_type === bbp_get_topic_post_type() ) {
    13501350            $post_status[] = bbp_get_closed_status_id();
    13511351        }
     
    15531553
    15541554                    // Only forum replies
    1555                     if ( !empty( $_GET['type'] ) && ( bbp_get_reply_post_type() == $_GET['type'] ) ) {
     1555                    if ( !empty( $_GET['type'] ) && ( bbp_get_reply_post_type() === $_GET['type'] ) ) {
    15561556
    15571557                        // The query
     
    15711571
    15721572                    // Only forum topics
    1573                     } elseif ( !empty( $_GET['type'] ) && ( bbp_get_topic_post_type() == $_GET['type'] ) ) {
     1573                    } elseif ( !empty( $_GET['type'] ) && ( bbp_get_topic_post_type() === $_GET['type'] ) ) {
    15741574
    15751575                        // The query
  • trunk/includes/common/template-tags.php

    r4989 r4995  
    129129
    130130    // Supplied ID is a forum
    131     if ( !empty( $post_id ) && ( bbp_get_forum_post_type() == get_post_type( $post_id ) ))
     131    if ( !empty( $post_id ) && ( bbp_get_forum_post_type() === get_post_type( $post_id ) ) )
    132132        $retval = true;
    133133
     
    201201
    202202    // Check query
    203     if ( !empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit == true ) )
     203    if ( !empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit === true ) )
    204204        $retval = true;
    205205
    206206    // Editing in admin
    207     elseif ( is_admin() && ( 'post.php' == $pagenow ) && ( get_post_type() == bbp_get_forum_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' == $_GET['action'] ) ) )
     207    elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_forum_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) )
    208208        $retval = true;
    209209
     
    227227
    228228    // Supplied ID is a topic
    229     if ( !empty( $post_id ) && ( bbp_get_topic_post_type() == get_post_type( $post_id ) ) )
     229    if ( !empty( $post_id ) && ( bbp_get_topic_post_type() === get_post_type( $post_id ) ) )
    230230        $retval = true;
    231231
     
    298298
    299299    // Check query
    300     if ( !empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit == true ) )
     300    if ( !empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit === true ) )
    301301        $retval = true;
    302302
    303303    // Editing in admin
    304     elseif ( is_admin() && ( 'post.php' == $pagenow ) && ( get_post_type() == bbp_get_topic_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' == $_GET['action'] ) ) )
     304    elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_topic_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) )
    305305        $retval = true;
    306306
     
    322322
    323323    // Check topic edit and GET params
    324     if ( bbp_is_topic_edit() && !empty( $_GET['action'] ) && ( 'merge' == $_GET['action'] ) )
     324    if ( bbp_is_topic_edit() && !empty( $_GET['action'] ) && ( 'merge' === $_GET['action'] ) )
    325325        return true;
    326326
     
    342342
    343343    // Check topic edit and GET params
    344     if ( bbp_is_topic_edit() && !empty( $_GET['action'] ) && ( 'split' == $_GET['action'] ) )
     344    if ( bbp_is_topic_edit() && !empty( $_GET['action'] ) && ( 'split' === $_GET['action'] ) )
    345345        $retval = true;
    346346
     
    394394
    395395    // Check query
    396     if ( !empty( $wp_query->bbp_is_topic_tag_edit ) && ( true == $wp_query->bbp_is_topic_tag_edit ) )
     396    if ( !empty( $wp_query->bbp_is_topic_tag_edit ) && ( true === $wp_query->bbp_is_topic_tag_edit ) )
    397397        $retval = true;
    398398
    399399    // Editing in admin
    400     elseif ( is_admin() && ( 'edit-tags.php' == $pagenow ) && ( bbp_get_topic_tag_tax_id() == $taxnow ) && ( !empty( $_GET['action'] ) && ( 'edit' == $_GET['action'] ) ) )
     400    elseif ( is_admin() && ( 'edit-tags.php' === $pagenow ) && ( bbp_get_topic_tag_tax_id() === $taxnow ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) )
    401401        $retval = true;
    402402
     
    449449
    450450    // Supplied ID is a reply
    451     if ( !empty( $post_id ) && ( bbp_get_reply_post_type() == get_post_type( $post_id ) ) )
     451    if ( !empty( $post_id ) && ( bbp_get_reply_post_type() === get_post_type( $post_id ) ) )
    452452        $retval = true;
    453453
     
    470470
    471471    // Check query
    472     if ( !empty( $wp_query->bbp_is_reply_edit ) && ( true == $wp_query->bbp_is_reply_edit ) )
     472    if ( !empty( $wp_query->bbp_is_reply_edit ) && ( true === $wp_query->bbp_is_reply_edit ) )
    473473        $retval = true;
    474474
    475475    // Editing in admin
    476     elseif ( is_admin() && ( 'post.php' == $pagenow ) && ( get_post_type() == bbp_get_reply_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' == $_GET['action'] ) ) )
     476    elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_reply_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) )
    477477        $retval = true;
    478478
     
    492492
    493493    // Check reply edit and GET params
    494     if ( bbp_is_reply_edit() && !empty( $_GET['action'] ) && ( 'move' == $_GET['action'] ) )
     494    if ( bbp_is_reply_edit() && !empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) )
    495495        $retval = true;
    496496
     
    540540
    541541    // Check query
    542     if ( !empty( $wp_query->bbp_is_single_user_favs ) && ( true == $wp_query->bbp_is_single_user_favs ) )
     542    if ( !empty( $wp_query->bbp_is_single_user_favs ) && ( true === $wp_query->bbp_is_single_user_favs ) )
    543543        $retval = true;
    544544
     
    560560
    561561    // Check query
    562     if ( !empty( $wp_query->bbp_is_single_user_subs ) && ( true == $wp_query->bbp_is_single_user_subs ) )
     562    if ( !empty( $wp_query->bbp_is_single_user_subs ) && ( true === $wp_query->bbp_is_single_user_subs ) )
    563563        $retval = true;
    564564
     
    581581
    582582    // Check query
    583     if ( !empty( $wp_query->bbp_is_single_user_topics ) && ( true == $wp_query->bbp_is_single_user_topics ) )
     583    if ( !empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) )
    584584        $retval = true;
    585585
     
    602602
    603603    // Check query
    604     if ( !empty( $wp_query->bbp_is_single_user_replies ) && ( true == $wp_query->bbp_is_single_user_replies ) )
     604    if ( !empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) )
    605605        $retval = true;
    606606
     
    625625
    626626    // Check query
    627     if ( !empty( $wp_query->bbp_is_single_user_home ) && ( true == $wp_query->bbp_is_single_user_home ) )
     627    if ( !empty( $wp_query->bbp_is_single_user_home ) && ( true === $wp_query->bbp_is_single_user_home ) )
    628628        $retval = true;
    629629
     
    667667
    668668    // Check query
    669     if ( !empty( $wp_query->bbp_is_single_user ) && ( true == $wp_query->bbp_is_single_user ) )
     669    if ( !empty( $wp_query->bbp_is_single_user ) && ( true === $wp_query->bbp_is_single_user ) )
    670670        $retval = true;
    671671
     
    688688
    689689    // Check query
    690     if ( !empty( $wp_query->bbp_is_single_user_edit ) && ( true == $wp_query->bbp_is_single_user_edit ) )
     690    if ( !empty( $wp_query->bbp_is_single_user_edit ) && ( true === $wp_query->bbp_is_single_user_edit ) )
    691691        $retval = true;
    692692
     
    709709
    710710    // Check query
    711     if ( !empty( $wp_query->bbp_is_single_user_profile ) && ( true == $wp_query->bbp_is_single_user_profile ) )
     711    if ( !empty( $wp_query->bbp_is_single_user_profile ) && ( true === $wp_query->bbp_is_single_user_profile ) )
    712712        $retval = true;
    713713
     
    730730
    731731    // Check query
    732     if ( !empty( $wp_query->bbp_is_single_user_topics ) && ( true == $wp_query->bbp_is_single_user_topics ) )
     732    if ( !empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) )
    733733        $retval = true;
    734734
     
    751751
    752752    // Check query
    753     if ( !empty( $wp_query->bbp_is_single_user_replies ) && ( true == $wp_query->bbp_is_single_user_replies ) )
     753    if ( !empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) )
    754754        $retval = true;
    755755
     
    773773
    774774    // Check query
    775     if ( !empty( $wp_query->bbp_is_view ) && ( true == $wp_query->bbp_is_view ) )
     775    if ( !empty( $wp_query->bbp_is_view ) && ( true === $wp_query->bbp_is_view ) )
    776776        $retval = true;
    777777
     
    803803
    804804    // Check query
    805     if ( !empty( $wp_query->bbp_is_search ) && ( true == $wp_query->bbp_is_search ) )
     805    if ( !empty( $wp_query->bbp_is_search ) && ( true === $wp_query->bbp_is_search ) )
    806806        $retval = true;
    807807
     
    866866
    867867    // Check query
    868     if ( !empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit == true ) )
     868    if ( !empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit === true ) )
    869869        $retval = true;
    870870
     
    14001400
    14011401        // Forums
    1402         if ( bbp_get_forum_post_type() == $r['post_type'] ) {
     1402        if ( bbp_get_forum_post_type() === $r['post_type'] ) {
    14031403
    14041404            // Private forums
     
    18261826    // Unset fullscreen
    18271827    foreach ( $plugins as $key => $value ) {
    1828         if ( 'fullscreen' == $value ) {
     1828        if ( 'fullscreen' === $value ) {
    18291829            unset( $plugins[$key] );
    18301830            break;
     
    20172017 */
    20182018function bbp_is_query_name( $name = '' )  {
    2019     return (bool) ( bbp_get_query_name() == $name );
     2019    return (bool) ( bbp_get_query_name() === $name );
    20202020}
    20212021
     
    21512151
    21522152        // Root slug is also the front page
    2153         if ( !empty( $front_id ) && ( $front_id == $root_id ) ) {
     2153        if ( !empty( $front_id ) && ( $front_id === $root_id ) ) {
    21542154            $pre_include_root = false;
    21552155        }
     
    21612161
    21622162        // Don't show root if viewing page in place of forum archive
    2163         if ( !empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id == get_the_ID() ) ) ) {
     2163        if ( !empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id === get_the_ID() ) ) ) {
    21642164            $pre_include_root = false;
    21652165        }
     
    24402440        // Loop through notices and separate errors from messages
    24412441        foreach ( $bbp->errors->get_error_messages( $code ) as $error ) {
    2442             if ( 'message' == $severity ) {
     2442            if ( 'message' === $severity ) {
    24432443                $messages[] = $error;
    24442444            } else {
     
    26092609
    26102610    // Compare new title with original title
    2611     if ( $title == $_title )
     2611    if ( $title === $_title )
    26122612        return $title;
    26132613
     
    26202620
    26212621    // sep on right, so reverse the order
    2622     if ( 'right' == $seplocation ) {
     2622    if ( 'right' === $seplocation ) {
    26232623        $title_array = array_reverse( explode( $t_sep, $title ) );
    26242624        $title       = implode( " $sep ", $title_array ) . $prefix;
  • trunk/includes/common/widgets.php

    r4971 r4995  
    804804
    805805                // Maybe get the topic author
    806                 if ( 'on' == $settings['show_user'] ) :
     806                if ( 'on' === $settings['show_user'] ) :
    807807                    $author_link = bbp_get_topic_author_link( array( 'post_id' => $topic_id, 'type' => 'both', 'size' => 14 ) );
    808808                endif; ?>
     
    817817                    <?php endif; ?>
    818818
    819                     <?php if ( 'on' == $settings['show_date'] ) : ?>
     819                    <?php if ( 'on' === $settings['show_date'] ) : ?>
    820820
    821821                        <div><?php bbp_topic_last_active_time( $topic_id ); ?></div>
     
    11551155
    11561156                    // Only query user if showing them
    1157                     if ( 'on' == $settings['show_user'] ) :
     1157                    if ( 'on' === $settings['show_user'] ) :
    11581158                        $author_link = bbp_get_reply_author_link( array( 'post_id' => $reply_id, 'type' => 'both', 'size' => 14 ) );
    11591159                    else :
     
    11621162
    11631163                    // Reply author, link, and timestamp
    1164                     if ( ( 'on' == $settings['show_date'] ) && !empty( $author_link ) ) :
     1164                    if ( ( 'on' === $settings['show_date'] ) && !empty( $author_link ) ) :
    11651165
    11661166                        // translators: 1: reply author, 2: reply link, 3: reply timestamp
     
    11681168
    11691169                    // Reply link and timestamp
    1170                     elseif ( 'on' == $settings['show_date'] ) :
     1170                    elseif ( 'on' === $settings['show_date'] ) :
    11711171
    11721172                        // translators: 1: reply link, 2: reply timestamp
  • trunk/includes/core/capabilities.php

    r4859 r4995  
    475475
    476476            // If keys match, unset
    477             if ( $wp_role == $bbp_role ) {
     477            if ( $wp_role === $bbp_role ) {
    478478                unset( $all_roles[$wp_role] );
    479479            }
  • trunk/includes/core/functions.php

    r4927 r4995  
    551551 */
    552552function bbp_is_post_request() {
    553     return (bool) ( 'POST' == strtoupper( $_SERVER['REQUEST_METHOD'] ) );
     553    return (bool) ( 'POST' === strtoupper( $_SERVER['REQUEST_METHOD'] ) );
    554554}
    555555
     
    561561 */
    562562function bbp_is_get_request() {
    563     return (bool) ( 'GET' == strtoupper( $_SERVER['REQUEST_METHOD'] ) );
    564 }
    565 
     563    return (bool) ( 'GET' === strtoupper( $_SERVER['REQUEST_METHOD'] ) );
     564}
     565
  • trunk/includes/core/template-functions.php

    r4940 r4995  
    102102
    103103    // Maybe load the template if one was located
    104     if ( ( true == $load ) && !empty( $located ) ) {
     104    if ( ( true === $load ) && !empty( $located ) ) {
    105105        load_template( $located, $require_once );
    106106    }
     
    316316
    317317    // Bail if filters are suppressed on this query
    318     if ( true == $posts_query->get( 'suppress_filters' ) )
     318    if ( true === $posts_query->get( 'suppress_filters' ) )
    319319        return;
    320320
     
    422422
    423423        // User is looking at their own profile
    424         if ( get_current_user_id() == $the_user->ID ) {
     424        if ( get_current_user_id() === $the_user->ID ) {
    425425            $posts_query->bbp_is_single_user_home = true;
    426426        }
  • trunk/includes/core/theme-compat.php

    r4976 r4995  
    259259        return false;
    260260
    261     return (bool) ( $bbp->theme_compat->original_template == $template );
     261    return (bool) ( $bbp->theme_compat->original_template === $template );
    262262}
    263263
  • trunk/includes/core/update.php

    r4910 r4995  
    5454    $action = false;
    5555
    56     if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
     56    if ( ! empty( $_REQUEST['action'] ) && ( '-1' !== $_REQUEST['action'] ) ) {
    5757        $action = $_REQUEST['action'];
    58     } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
     58    } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' !== $_REQUEST['action2'] ) ) {
    5959        $action = $_REQUEST['action2'];
    6060    }
     
    6666
    6767    // The plugin(s) being activated
    68     if ( $action == 'activate' ) {
     68    if ( $action === 'activate' ) {
    6969        $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
    7070    } else {
     
    9696    $action = false;
    9797   
    98     if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
     98    if ( ! empty( $_REQUEST['action'] ) && ( '-1' !== $_REQUEST['action'] ) ) {
    9999        $action = $_REQUEST['action'];
    100     } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
     100    } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' !== $_REQUEST['action2'] ) ) {
    101101        $action = $_REQUEST['action2'];
    102102    }
     
    108108
    109109    // The plugin(s) being deactivated
    110     if ( $action == 'deactivate' ) {
     110    if ( $action === 'deactivate' ) {
    111111        $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
    112112    } else {
  • trunk/includes/extend/akismet.php

    r4959 r4995  
    9898
    9999        // Post is not published
    100         if ( bbp_get_public_status_id() != $post_data['post_status'] )
     100        if ( bbp_get_public_status_id() !== $post_data['post_status'] )
    101101            return $post_data;
    102102
     
    166166
    167167        // Spam
    168         if ( 'true' == $post_data['bbp_akismet_result'] ) {
     168        if ( 'true' === $post_data['bbp_akismet_result'] ) {
    169169
    170170            // Let plugins do their thing
     
    255255
    256256        // Bail if we're spamming, but the post_status isn't spam
    257         if ( ( 'spam' == $request_type ) && ( bbp_get_spam_status_id() != $_post->post_status ) )
     257        if ( ( 'spam' === $request_type ) && ( bbp_get_spam_status_id() !== $_post->post_status ) )
    258258            return;
    259259
     
    385385
    386386        // Aim...
    387         if ( 'check' == $check ) {
     387        if ( 'check' === $check ) {
    388388            $path = '/1.1/comment-check';
    389         } elseif ( 'submit' == $check ) {
     389        } elseif ( 'submit' === $check ) {
    390390            $path = '/1.1/submit-' . $spam;
    391391        }
     
    446446
    447447            // More checks
    448             if (    intval( $as_submitted['comment_post_ID'] )    == intval( $_post->post_parent )
    449                     &&      $as_submitted['comment_author']       == ( $anonymous_data ? $anonymous_data['bbp_anonymous_name']  : $userdata->display_name )
    450                     &&      $as_submitted['comment_author_email'] == ( $anonymous_data ? $anonymous_data['bbp_anonymous_email'] : $userdata->user_email   )
     448            if (    intval( $as_submitted['comment_post_ID'] )    === intval( $_post->post_parent )
     449                    &&      $as_submitted['comment_author']       === ( $anonymous_data ? $anonymous_data['bbp_anonymous_name']  : $userdata->display_name )
     450                    &&      $as_submitted['comment_author_email'] === ( $anonymous_data ? $anonymous_data['bbp_anonymous_email'] : $userdata->user_email   )
    451451                ) {
    452452
    453453                // Normal result: true
    454                 if ( $this->last_post['bbp_akismet_result'] == 'true' ) {
     454                if ( $this->last_post['bbp_akismet_result'] === 'true' ) {
    455455
    456456                    // Leave a trail so other's know what we did
     
    459459
    460460                    // If post_status isn't the spam status, as expected, leave a note
    461                     if ( $_post->post_status != bbp_get_spam_status_id() ) {
     461                    if ( bbp_get_spam_status_id() !== $_post->post_status ) {
    462462                        $this->update_post_history( $post_id, sprintf( esc_html__( 'Post status was changed to %s', 'bbpress' ), $_post->post_status ), 'status-changed-' . $_post->post_status );
    463463                    }
    464464
    465465                // Normal result: false
    466                 } elseif ( $this->last_post['bbp_akismet_result'] == 'false' ) {
     466                } elseif ( $this->last_post['bbp_akismet_result'] === 'false' ) {
    467467
    468468                    // Leave a trail so other's know what we did
     
    471471
    472472                    // If post_status is the spam status, which isn't expected, leave a note
    473                     if ( $_post->post_status == bbp_get_spam_status_id() ) {
     473                    if ( bbp_get_spam_status_id() === $_post->post_status ) {
    474474
    475475                        // @todo Use wp_blacklist_check()
     
    661661
    662662            // Open a socket connection
    663             if ( false != ( $fs = @fsockopen( $http_host, $port, $errno, $errstr, 10 ) ) ) {
     663            if ( false !== ( $fs = @fsockopen( $http_host, $port, $errno, $errstr, 10 ) ) ) {
    664664
    665665                // Write our request to the pointer
  • trunk/includes/extend/buddypress/activity.php

    r4959 r4995  
    632632
    633633        // Action based on new status
    634         if ( $post->post_status == bbp_get_public_status_id() ) {
     634        if ( bbp_get_public_status_id() === $post->post_status ) {
    635635
    636636            // Validate reply data
  • trunk/includes/extend/buddypress/functions.php

    r4733 r4995  
    3939
    4040    // Currently viewing or editing a user
    41     elseif ( ( true == $displayed_user_fallback ) && !empty( $did ) )
     41    elseif ( ( true === $displayed_user_fallback ) && !empty( $did ) )
    4242        $bbp_user_id = $did;
    4343
    4444    // Maybe fallback on the current_user ID
    45     elseif ( ( true == $current_user_fallback ) && !empty( $lid ) )
     45    elseif ( ( true === $current_user_fallback ) && !empty( $lid ) )
    4646        $bbp_user_id = $lid;
    4747
  • trunk/includes/extend/buddypress/group.php

    r4959 r4995  
    792792
    793793                    // Topic edit
    794                     if ( bp_action_variable( $offset + 2 ) == bbp_get_edit_rewrite_id() ) :
     794                    if ( bp_action_variable( $offset + 2 ) === bbp_get_edit_rewrite_id() ) :
    795795
    796796                        // Unset the super sticky link on edit topic template
     
    805805
    806806                        // Merge
    807                         if ( !empty( $_GET['action'] ) && 'merge' == $_GET['action'] ) :
     807                        if ( !empty( $_GET['action'] ) && 'merge' === $_GET['action'] ) :
    808808                            bbp_set_query_name( 'bbp_topic_merge' );
    809809                            bbp_get_template_part( 'form', 'topic-merge' );
    810810
    811811                        // Split
    812                         elseif ( !empty( $_GET['action'] ) && 'split' == $_GET['action'] ) :
     812                        elseif ( !empty( $_GET['action'] ) && 'split' === $_GET['action'] ) :
    813813                            bbp_set_query_name( 'bbp_topic_split' );
    814814                            bbp_get_template_part( 'form', 'topic-split' );
     
    851851                    <h3><?php bbp_reply_title(); ?></h3>
    852852
    853                     <?php if ( bp_action_variable( $offset + 2 ) == bbp_get_edit_rewrite_id() ) :
     853                    <?php if ( bp_action_variable( $offset + 2 ) === bbp_get_edit_rewrite_id() ) :
    854854
    855855                        // Set the edit switches
     
    861861
    862862                        // Move
    863                         if ( !empty( $_GET['action'] ) && ( 'move' == $_GET['action'] ) ) :
     863                        if ( !empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) ) :
    864864                            bbp_set_query_name( 'bbp_reply_move' );
    865865                            bbp_get_template_part( 'form', 'reply-move' );
  • trunk/includes/forums/capabilities.php

    r4835 r4995  
    7878
    7979                    // Post is public
    80                     if ( bbp_get_public_status_id() == $_post->post_status ) {
     80                    if ( bbp_get_public_status_id() === $_post->post_status ) {
    8181                        $caps = array( 'spectate' );
    8282
    8383                    // User is author so allow read
    84                     } elseif ( (int) $user_id == (int) $_post->post_author ) {
     84                    } elseif ( (int) $user_id === (int) $_post->post_author ) {
    8585                        $caps = array( 'spectate' );
    8686
     
    138138
    139139                // User is author so allow edit
    140                 } elseif ( (int) $user_id == (int) $_post->post_author ) {
     140                } elseif ( (int) $user_id === (int) $_post->post_author ) {
    141141                    $caps[] = $post_type->cap->edit_posts;
    142142
     
    167167
    168168                // User is author so allow to delete
    169                 } elseif ( (int) $user_id == (int) $_post->post_author ) {
     169                } elseif ( (int) $user_id === (int) $_post->post_author ) {
    170170                    $caps[] = $post_type->cap->delete_posts;
    171171
  • trunk/includes/forums/functions.php

    r4990 r4995  
    137137
    138138    // Remove kses filters from title and content for capable users and if the nonce is verified
    139     if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && wp_create_nonce( 'bbp-unfiltered-html-forum_new' ) == $_POST['_bbp_unfiltered_html_forum'] ) {
     139    if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && wp_create_nonce( 'bbp-unfiltered-html-forum_new' ) === $_POST['_bbp_unfiltered_html_forum'] ) {
    140140        remove_filter( 'bbp_new_forum_pre_title',   'wp_filter_kses'      );
    141141        remove_filter( 'bbp_new_forum_pre_content', 'bbp_encode_bad',  10 );
     
    258258        // If the forum is trash, or the forum_status is switched to
    259259        // trash, trash it properly
    260         if ( ( get_post_field( 'post_status', $forum_id ) == bbp_get_trash_status_id() ) || ( $forum_data['post_status'] == bbp_get_trash_status_id() ) ) {
     260        if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( $forum_data['post_status'] === bbp_get_trash_status_id() ) ) {
    261261
    262262            // Trash the reply
     
    270270
    271271        // If reply or forum are spam, officially spam this reply
    272         if ( $forum_data['post_status'] == bbp_get_spam_status_id() ) {
     272        if ( $forum_data['post_status'] === bbp_get_spam_status_id() ) {
    273273            add_post_meta( $forum_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
    274274
     
    407407
    408408    // Remove kses filters from title and content for capable users and if the nonce is verified
    409     if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-forum_' . $forum_id ) == $_POST['_bbp_unfiltered_html_forum'] ) ) {
     409    if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-forum_' . $forum_id ) === $_POST['_bbp_unfiltered_html_forum'] ) ) {
    410410        remove_filter( 'bbp_edit_forum_pre_title',   'wp_filter_kses'      );
    411411        remove_filter( 'bbp_edit_forum_pre_content', 'bbp_encode_bad',  10 );
     
    509509
    510510    // Update revision log
    511     if ( !empty( $_POST['bbp_log_forum_edit'] ) && ( 1 == $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) {
     511    if ( !empty( $_POST['bbp_log_forum_edit'] ) && ( 1 === $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) {
    512512        bbp_update_forum_revision_log( array(
    513513            'forum_id'    => $forum_id,
     
    539539        // as the first arg and new forum parent id as the second.
    540540        // @todo implement
    541         //if ( $forum_id != $forum->post_parent )
     541        //if ( $forum_id !== $forum->post_parent )
    542542        //  bbp_move_forum_handler( $forum_parent_id, $forum->post_parent, $forum_id );
    543543
     
    612612
    613613    if ( !empty( $_POST['bbp_forum_status'] ) && in_array( $_POST['bbp_forum_status'], array( 'open', 'closed' ) ) ) {
    614         if ( 'closed' == $_POST['bbp_forum_status'] && !bbp_is_forum_closed( $forum_id, false ) ) {
     614        if ( 'closed' === $_POST['bbp_forum_status'] && !bbp_is_forum_closed( $forum_id, false ) ) {
    615615            bbp_close_forum( $forum_id );
    616         } elseif ( 'open' == $_POST['bbp_forum_status'] && bbp_is_forum_closed( $forum_id, false ) ) {
     616        } elseif ( 'open' === $_POST['bbp_forum_status'] && bbp_is_forum_closed( $forum_id, false ) ) {
    617617            bbp_open_forum( $forum_id );
    618618        }
     
    622622
    623623    if ( !empty( $_POST['bbp_forum_type'] ) && in_array( $_POST['bbp_forum_type'], array( 'forum', 'category' ) ) ) {
    624         if ( 'category' == $_POST['bbp_forum_type'] && !bbp_is_forum_category( $forum_id ) ) {
     624        if ( 'category' === $_POST['bbp_forum_type'] && !bbp_is_forum_category( $forum_id ) ) {
    625625            bbp_categorize_forum( $forum_id );
    626         } elseif ( 'forum' == $_POST['bbp_forum_type'] && bbp_is_forum_category( $forum_id ) ) {
     626        } elseif ( 'forum' === $_POST['bbp_forum_type'] && bbp_is_forum_category( $forum_id ) ) {
    627627            bbp_normalize_forum( $forum_id );
    628628        }
     
    799799
    800800    // Only run queries if visibility is changing
    801     if ( bbp_get_public_status_id() != $current_visibility ) {
     801    if ( bbp_get_public_status_id() !== $current_visibility ) {
    802802
    803803        // Update forum post_status
     
    828828
    829829    // Only run queries if visibility is changing
    830     if ( bbp_get_private_status_id() != $current_visibility ) {
     830    if ( bbp_get_private_status_id() !== $current_visibility ) {
    831831
    832832        // Get hidden forums
     
    877877
    878878    // Only run queries if visibility is changing
    879     if ( bbp_get_hidden_status_id() != $current_visibility ) {
     879    if ( bbp_get_hidden_status_id() !== $current_visibility ) {
    880880
    881881        // Get private forums
     
    12261226
    12271227    // Update only if published
    1228     if ( bbp_get_public_status_id() == get_post_status( $active_id ) )
     1228    if ( bbp_get_public_status_id() === get_post_status( $active_id ) )
    12291229        update_post_meta( $forum_id, '_bbp_last_active_id', (int) $active_id );
    12301230
     
    14761476    }
    14771477
    1478     if ( bbp_get_public_status_id() == $r['last_active_status'] ) {
     1478    if ( bbp_get_public_status_id() === $r['last_active_status'] ) {
    14791479        bbp_update_forum_last_active_time( $r['forum_id'], $r['last_active_time'] );
    14801480    }
     
    16421642
    16431643    // Bail if filters are suppressed on this query
    1644     if ( true == $posts_query->get( 'suppress_filters' ) ) {
     1644    if ( true === $posts_query->get( 'suppress_filters' ) ) {
    16451645        return;
    16461646    }
  • trunk/includes/forums/template-tags.php

    r4952 r4995  
    206206
    207207    // Tweak the data type to return
    208     if ( $output == OBJECT ) {
     208    if ( $output === OBJECT ) {
    209209        return $forum;
    210210
    211     } elseif ( $output == ARRAY_A ) {
     211    } elseif ( $output === ARRAY_A ) {
    212212        $_forum = get_object_vars( $forum );
    213213        return $_forum;
    214214
    215     } elseif ( $output == ARRAY_N ) {
     215    } elseif ( $output === ARRAY_N ) {
    216216        $_forum = array_values( get_object_vars( $forum ) );
    217217        return $_forum;
     
    14331433    $forum_id = bbp_get_forum_id( $forum_id );
    14341434    $type     = bbp_get_forum_type( $forum_id );
    1435     $retval   = ( !empty( $type ) && 'category' == $type );
     1435    $retval   = ( !empty( $type ) && 'category' === $type );
    14361436
    14371437    return (bool) apply_filters( 'bbp_is_forum_category', (bool) $retval, $forum_id );
     
    14691469
    14701470        $forum_id = bbp_get_forum_id( $forum_id );
    1471         $retval    = ( bbp_get_closed_status_id() == bbp_get_forum_status( $forum_id ) );
     1471        $retval    = ( bbp_get_closed_status_id() === bbp_get_forum_status( $forum_id ) );
    14721472
    14731473        if ( !empty( $check_ancestors ) ) {
     
    15041504
    15051505    // If post status is public, return true
    1506     $retval = ( bbp_get_public_status_id() == $visibility );
     1506    $retval = ( bbp_get_public_status_id() === $visibility );
    15071507
    15081508    // Check ancestors and inherit their privacy setting for display
     
    15401540
    15411541    // If post status is private, return true
    1542     $retval = ( bbp_get_private_status_id() == $visibility );
     1542    $retval = ( bbp_get_private_status_id() === $visibility );
    15431543
    15441544    // Check ancestors and inherit their privacy setting for display
     
    15761576
    15771577    // If post status is private, return true
    1578     $retval = ( bbp_get_hidden_status_id() == $visibility );
     1578    $retval = ( bbp_get_hidden_status_id() === $visibility );
    15791579
    15801580    // Check ancestors and inherit their privacy setting for display
  • trunk/includes/replies/capabilities.php

    r4835 r4995  
    6767
    6868                    // Post is public
    69                     if ( bbp_get_public_status_id() == $_post->post_status ) {
     69                    if ( bbp_get_public_status_id() === $_post->post_status ) {
    7070                        $caps = array( 'spectate' );
    7171
    7272                    // User is author so allow read
    73                     } elseif ( (int) $user_id == (int) $_post->post_author ) {
     73                    } elseif ( (int) $user_id === (int) $_post->post_author ) {
    7474                        $caps = array( 'spectate' );
    7575
     
    127127
    128128                // User is author so allow edit
    129                 } elseif ( (int) $user_id == (int) $_post->post_author ) {
     129                } elseif ( (int) $user_id === (int) $_post->post_author ) {
    130130                    $caps[] = $post_type->cap->edit_posts;
    131131
  • trunk/includes/replies/functions.php

    r4992 r4995  
    210210
    211211    // Remove kses filters from title and content for capable users and if the nonce is verified
    212     if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $topic_id ) == $_POST['_bbp_unfiltered_html_reply'] ) {
     212    if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $topic_id ) === $_POST['_bbp_unfiltered_html_reply'] ) {
    213213        remove_filter( 'bbp_new_reply_pre_title',   'wp_filter_kses'      );
    214214        remove_filter( 'bbp_new_reply_pre_content', 'bbp_encode_bad',  10 );
     
    336336        // If this reply starts as trash, add it to pre_trashed_replies
    337337        // for the topic, so it is properly restored.
    338         if ( bbp_is_topic_trash( $topic_id ) || ( $reply_data['post_status'] == bbp_get_trash_status_id() ) ) {
     338        if ( bbp_is_topic_trash( $topic_id ) || ( $reply_data['post_status'] === bbp_get_trash_status_id() ) ) {
    339339
    340340            // Trash the reply
     
    357357
    358358        // If reply or topic are spam, officially spam this reply
    359         } elseif ( bbp_is_topic_spam( $topic_id ) || ( $reply_data['post_status'] == bbp_get_spam_status_id() ) ) {
     359        } elseif ( bbp_is_topic_spam( $topic_id ) || ( $reply_data['post_status'] === bbp_get_spam_status_id() ) ) {
    360360            add_post_meta( $reply_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
    361361
     
    501501
    502502    // Remove kses filters from title and content for capable users and if the nonce is verified
    503     if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $reply_id ) == $_POST['_bbp_unfiltered_html_reply'] ) {
     503    if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $reply_id ) === $_POST['_bbp_unfiltered_html_reply'] ) {
    504504        remove_filter( 'bbp_edit_reply_pre_title',   'wp_filter_kses'      );
    505505        remove_filter( 'bbp_edit_reply_pre_content', 'bbp_encode_bad',  10 );
     
    580580
    581581        // Set post status to pending if public
    582         if ( bbp_get_public_status_id() == $reply->post_status ) {
     582        if ( bbp_get_public_status_id() === $reply->post_status ) {
    583583            $reply_status = bbp_get_pending_status_id();
    584584        }
     
    661661
    662662    // Update revision log
    663     if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( 1 == $_POST['bbp_log_reply_edit'] ) ) {
     663    if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( 1 === $_POST['bbp_log_reply_edit'] ) ) {
    664664        $revision_id = wp_save_post_revision( $reply_id );
    665665        if ( !empty( $revision_id ) ) {
     
    795795    if ( bbp_is_subscriptions_active() && !empty( $author_id ) && !empty( $topic_id ) ) {
    796796        $subscribed = bbp_is_user_subscribed( $author_id, $topic_id );
    797         $subscheck  = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' == $_POST['bbp_topic_subscription'] ) ) ? true : false;
     797        $subscheck  = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' === $_POST['bbp_topic_subscription'] ) ) ? true : false;
    798798
    799799        // Subscribed and unsubscribing
    800         if ( true == $subscribed && false == $subscheck ) {
     800        if ( true === $subscribed && false === $subscheck ) {
    801801            bbp_remove_user_subscription( $author_id, $topic_id );
    802802
    803803        // Subscribing
    804         } elseif ( false == $subscribed && true == $subscheck ) {
     804        } elseif ( false === $subscribed && true === $subscheck ) {
    805805            bbp_add_user_subscription( $author_id, $topic_id );
    806806        }
     
    886886
    887887    // If we want a full refresh, unset any of the possibly passed variables
    888     if ( true == $refresh )
     888    if ( true === $refresh )
    889889        $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0;
    890890
     
    983983
    984984                // Get first parent that is a forum
    985                 if ( get_post_field( 'post_type', $ancestor ) == bbp_get_forum_post_type() ) {
     985                if ( get_post_field( 'post_type', $ancestor ) === bbp_get_forum_post_type() ) {
    986986                    $forum_id = $ancestor;
    987987
     
    10321032
    10331033                // Get first parent that is a forum
    1034                 if ( get_post_field( 'post_type', $ancestor ) == bbp_get_topic_post_type() ) {
     1034                if ( get_post_field( 'post_type', $ancestor ) === bbp_get_topic_post_type() ) {
    10351035                    $topic_id = $ancestor;
    10361036
     
    12921292
    12931293                    // Shouldn't happen
    1294                     if ( false == $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) {
     1294                    if ( false === $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) {
    12951295                        bbp_add_error( 'bbp_move_reply_destination_reply', __( '<strong>ERROR</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) );
    12961296                    }
     
    13521352    // It is a new topic and we need to set some default metas to make
    13531353    // the topic display in bbp_has_topics() list
    1354     if ( 'topic' == $move_option ) {
     1354    if ( 'topic' === $move_option ) {
    13551355        bbp_update_topic_last_reply_id   ( $destination_topic->ID, $last_reply_id );
    13561356        bbp_update_topic_last_active_id  ( $destination_topic->ID, $last_reply_id );
     
    14791479
    14801480    // What is the user doing here?
    1481     if ( !current_user_can( 'edit_reply', $reply->ID ) || ( 'bbp_toggle_reply_trash' == $action && !current_user_can( 'delete_reply', $reply->ID ) ) ) {
     1481    if ( !current_user_can( 'edit_reply', $reply->ID ) || ( 'bbp_toggle_reply_trash' === $action && !current_user_can( 'delete_reply', $reply->ID ) ) ) {
    14821482        bbp_add_error( 'bbp_toggle_reply_permission', __( '<strong>ERROR:</strong> You do not have the permission to do that!', 'bbpress' ) );
    14831483        return;
     
    15401540
    15411541    // No errors
    1542     if ( ( false != $success ) && !is_wp_error( $success ) ) {
     1542    if ( ( false !== $success ) && !is_wp_error( $success ) ) {
    15431543
    15441544        /** Redirect **********************************************************/
     
    15891589
    15901590    // Bail if already spam
    1591     if ( bbp_get_spam_status_id() == $reply['post_status'] )
     1591    if ( bbp_get_spam_status_id() === $reply['post_status'] )
    15921592        return false;
    15931593
     
    16361636
    16371637    // Bail if already not spam
    1638     if ( bbp_get_spam_status_id() != $reply['post_status'] )
     1638    if ( bbp_get_spam_status_id() !== $reply['post_status'] )
    16391639        return false;
    16401640
     
    18581858
    18591859    // Bail if not a topic and reply query
    1860     if ( array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) != $query->get( 'post_type' ) ) {
     1860    if ( array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) !== $query->get( 'post_type' ) ) {
    18611861        return $where;
    18621862    }
     
    21162116
    21172117    // If reply is actually the first post in a topic, return 0
    2118     if ( $reply_id != $topic_id ) {
     2118    if ( $reply_id !== $topic_id ) {
    21192119
    21202120        // Make sure the topic has replies before running another query
  • trunk/includes/replies/template-tags.php

    r4985 r4995  
    151151
    152152                // Make sure it's a reply to a reply
    153                 if ( empty( $reply_to ) || ( bbp_get_reply_topic_id( $post->ID ) == $reply_to ) ) {
     153                if ( empty( $reply_to ) || ( bbp_get_reply_topic_id( $post->ID ) === $reply_to ) ) {
    154154                    $reply_to = 0;
    155155                }
     
    342342        return null;
    343343
    344     if ( $output == OBJECT ) {
     344    if ( $output === OBJECT ) {
    345345        return $reply;
    346346
    347     } elseif ( $output == ARRAY_A ) {
     347    } elseif ( $output === ARRAY_A ) {
    348348        $_reply = get_object_vars( $reply );
    349349        return $_reply;
    350350
    351     } elseif ( $output == ARRAY_N ) {
     351    } elseif ( $output === ARRAY_N ) {
    352352        $_reply = array_values( get_object_vars( $reply ) );
    353353        return $_reply;
     
    827827 */
    828828function bbp_is_reply_published( $reply_id = 0 ) {
    829     $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) == bbp_get_public_status_id();
     829    $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) === bbp_get_public_status_id();
    830830    return (bool) apply_filters( 'bbp_is_reply_published', (bool) $reply_status, $reply_id );
    831831}
     
    842842 */
    843843function bbp_is_reply_spam( $reply_id = 0 ) {
    844     $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) == bbp_get_spam_status_id();
     844    $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) === bbp_get_spam_status_id();
    845845    return (bool) apply_filters( 'bbp_is_reply_spam', (bool) $reply_status, $reply_id );
    846846}
     
    857857 */
    858858function bbp_is_reply_trash( $reply_id = 0 ) {
    859     $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) == bbp_get_trash_status_id();
     859    $reply_status = bbp_get_reply_status( bbp_get_reply_id( $reply_id ) ) === bbp_get_trash_status_id();
    860860    return (bool) apply_filters( 'bbp_is_reply_trash', (bool) $reply_status, $reply_id );
    861861}
     
    11321132
    11331133            // Get avatar
    1134             if ( 'avatar' == $r['type'] || 'both' == $r['type'] ) {
     1134            if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
    11351135                $author_links['avatar'] = bbp_get_reply_author_avatar( $reply_id, $r['size'] );
    11361136            }
    11371137
    11381138            // Get display name
    1139             if ( 'name' == $r['type']   || 'both' == $r['type'] ) {
     1139            if ( 'name' === $r['type']   || 'both' === $r['type'] ) {
    11401140                $author_links['name'] = bbp_get_reply_author_display_name( $reply_id );
    11411141            }
     
    14501450        $ancestor_id = $reply_id;
    14511451        while ( $parent_id = bbp_get_reply_to( $ancestor_id ) ) {
    1452             if ( empty( $parent_id ) || ( $parent_id === $ancestor_id ) || ( bbp_get_reply_topic_id( $reply_id ) === $parent_id ) || ( $parent_id == $reply_id ) ) {
     1452            if ( empty( $parent_id ) || ( $parent_id === $ancestor_id ) || ( bbp_get_reply_topic_id( $reply_id ) === $parent_id ) || ( $parent_id === $reply_id ) ) {
    14531453                break;
    14541454            }
     
    16561656
    16571657            // Post is not the topic
    1658             if ( $reply_id != $topic_id ) {
     1658            if ( $reply_id !== $topic_id ) {
    16591659                $reply_position = bbp_get_reply_position_raw( $reply_id, $topic_id );
    16601660
     
    21992199        $classes[] = 'bbp-reply-position-' . bbp_get_reply_position( $reply_id );
    22002200        $classes[] = 'user-id-' . bbp_get_reply_author_id( $reply_id );
    2201         $classes[] = ( bbp_get_reply_author_id( $reply_id ) == bbp_get_topic_author_id( bbp_get_reply_topic_id( $reply_id ) ) ? 'topic-author' : '' );
     2201        $classes[] = ( bbp_get_reply_author_id( $reply_id ) === bbp_get_topic_author_id( bbp_get_reply_topic_id( $reply_id ) ) ? 'topic-author' : '' );
    22022202        $classes   = array_filter( $classes );
    22032203        $classes   = get_post_class( $classes, $reply_id );
  • trunk/includes/topics/capabilities.php

    r4835 r4995  
    8585
    8686                    // Post is public
    87                     if ( bbp_get_public_status_id() == $_post->post_status ) {
     87                    if ( bbp_get_public_status_id() === $_post->post_status ) {
    8888                        $caps = array( 'spectate' );
    8989
    9090                    // User is author so allow read
    91                     } elseif ( (int) $user_id == (int) $_post->post_author ) {
     91                    } elseif ( (int) $user_id === (int) $_post->post_author ) {
    9292                        $caps = array( 'spectate' );
    9393
     
    145145
    146146                // User is author so allow edit
    147                 } elseif ( (int) $user_id == (int) $_post->post_author ) {
     147                } elseif ( (int) $user_id === (int) $_post->post_author ) {
    148148                    $caps[] = $post_type->cap->edit_posts;
    149149
  • trunk/includes/topics/functions.php

    r4990 r4995  
    157157
    158158    // Remove kses filters from title and content for capable users and if the nonce is verified
    159     if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_topic'] ) && wp_create_nonce( 'bbp-unfiltered-html-topic_new' ) == $_POST['_bbp_unfiltered_html_topic'] ) {
     159    if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_topic'] ) && wp_create_nonce( 'bbp-unfiltered-html-topic_new' ) === $_POST['_bbp_unfiltered_html_topic'] ) {
    160160        remove_filter( 'bbp_new_topic_pre_title',   'wp_filter_kses'      );
    161161        remove_filter( 'bbp_new_topic_pre_content', 'bbp_encode_bad',  10 );
     
    304304        // If the forum is trash, or the topic_status is switched to
    305305        // trash, trash it properly
    306         if ( ( get_post_field( 'post_status', $forum_id ) == bbp_get_trash_status_id() ) || ( $topic_data['post_status'] == bbp_get_trash_status_id() ) ) {
     306        if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( $topic_data['post_status'] === bbp_get_trash_status_id() ) ) {
    307307
    308308            // Trash the reply
     
    316316
    317317        // If reply or topic are spam, officially spam this reply
    318         if ( $topic_data['post_status'] == bbp_get_spam_status_id() ) {
     318        if ( $topic_data['post_status'] === bbp_get_spam_status_id() ) {
    319319            add_post_meta( $topic_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
    320320
     
    488488
    489489    // Remove kses filters from title and content for capable users and if the nonce is verified
    490     if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_topic'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-topic_' . $topic_id ) == $_POST['_bbp_unfiltered_html_topic'] ) ) {
     490    if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_topic'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-topic_' . $topic_id ) === $_POST['_bbp_unfiltered_html_topic'] ) ) {
    491491        remove_filter( 'bbp_edit_topic_pre_title',   'wp_filter_kses'      );
    492492        remove_filter( 'bbp_edit_topic_pre_content', 'bbp_encode_bad',  10 );
     
    659659
    660660        // Update revision log
    661         if ( !empty( $_POST['bbp_log_topic_edit'] ) && ( 1 == $_POST['bbp_log_topic_edit'] ) )  {
     661        if ( !empty( $_POST['bbp_log_topic_edit'] ) && ( 1 === $_POST['bbp_log_topic_edit'] ) )  {
    662662            $revision_id = wp_save_post_revision( $topic_id );
    663663            if ( ! empty( $revision_id ) ) {
     
    676676        // bbp_move_topic action and pass the topic's forum id as the
    677677        // first arg and topic id as the second to update counts.
    678         if ( $forum_id != $topic->post_parent ) {
     678        if ( $forum_id !== $topic->post_parent ) {
    679679            bbp_move_topic_handler( $topic_id, $topic->post_parent, $forum_id );
    680680        }
     
    822822    if ( bbp_is_subscriptions_active() && !empty( $author_id ) ) {
    823823        $subscribed = bbp_is_user_subscribed( $author_id, $topic_id );
    824         $subscheck  = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' == $_POST['bbp_topic_subscription'] ) ) ? true : false;
     824        $subscheck  = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' === $_POST['bbp_topic_subscription'] ) ) ? true : false;
    825825
    826826        // Subscribed and unsubscribing
    827         if ( true == $subscribed && false == $subscheck ) {
     827        if ( true === $subscribed && false === $subscheck ) {
    828828            bbp_remove_user_subscription( $author_id, $topic_id );
    829829
    830830        // Subscribing
    831         } elseif ( false == $subscribed && true == $subscheck ) {
     831        } elseif ( false === $subscribed && true === $subscheck ) {
    832832            bbp_add_user_subscription( $author_id, $topic_id );
    833833        }
     
    905905
    906906    // If we want a full refresh, unset any of the possibly passed variables
    907     if ( true == $refresh ) {
     907    if ( true === $refresh ) {
    908908        $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0;
    909909        $topic_status = bbp_get_public_status_id();
     
    975975        // Loop through stickies of forum and add misses to the updated array
    976976        foreach ( (array) $old_stickies as $sticky_topic_id ) {
    977             if ( $topic_id != $sticky_topic_id ) {
     977            if ( $topic_id !== $sticky_topic_id ) {
    978978                $updated_stickies[] = $sticky_topic_id;
    979979            }
     
    981981
    982982        // If stickies are different, update or delete them
    983         if ( $updated_stickies != $old_stickies ) {
     983        if ( $updated_stickies !== $old_stickies ) {
    984984
    985985            // No more stickies so delete the meta
     
    11761176
    11771177            // Shift the subscriber if told to
    1178             if ( !empty( $_POST['bbp_topic_subscribers'] ) && ( 1 == $_POST['bbp_topic_subscribers'] ) && bbp_is_subscriptions_active() )
     1178            if ( !empty( $_POST['bbp_topic_subscribers'] ) && ( 1 === $_POST['bbp_topic_subscribers'] ) && bbp_is_subscriptions_active() )
    11791179                bbp_add_user_subscription( $subscriber, $destination_topic->ID );
    11801180
     
    11961196
    11971197            // Shift the favoriter if told to
    1198             if ( !empty( $_POST['bbp_topic_favoriters'] ) && 1 == $_POST['bbp_topic_favoriters'] )
     1198            if ( !empty( $_POST['bbp_topic_favoriters'] ) && 1 === $_POST['bbp_topic_favoriters'] )
    11991199                bbp_add_user_favorite( $favoriter, $destination_topic->ID );
    12001200
     
    12131213
    12141214        // Shift the tags if told to
    1215         if ( !empty( $_POST['bbp_topic_tags'] ) && ( 1 == $_POST['bbp_topic_tags'] ) )
     1215        if ( !empty( $_POST['bbp_topic_tags'] ) && ( 1 === $_POST['bbp_topic_tags'] ) )
    12161216            wp_set_post_terms( $destination_topic->ID, $source_topic_tags, bbp_get_topic_tag_tax_id(), true );
    12171217
     
    14861486
    14871487                    // Shouldn't happen
    1488                     if ( false == $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) {
     1488                    if ( false === $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) {
    14891489                        bbp_add_error( 'bbp_split_topic_destination_reply', __( '<strong>ERROR</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) );
    14901490                    }
     
    15271527
    15281528    // Copy the subscribers
    1529     if ( !empty( $_POST['bbp_topic_subscribers'] ) && 1 == $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
     1529    if ( !empty( $_POST['bbp_topic_subscribers'] ) && 1 === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
    15301530
    15311531        // Get the subscribers
     
    15441544
    15451545    // Copy the favoriters if told to
    1546     if ( !empty( $_POST['bbp_topic_favoriters'] ) && 1 == $_POST['bbp_topic_favoriters'] ) {
     1546    if ( !empty( $_POST['bbp_topic_favoriters'] ) && 1 === $_POST['bbp_topic_favoriters'] ) {
    15471547
    15481548        // Get the favoriters
     
    15611561
    15621562    // Copy the tags if told to
    1563     if ( !empty( $_POST['bbp_topic_tags'] ) && ( 1 == $_POST['bbp_topic_tags'] ) ) {
     1563    if ( !empty( $_POST['bbp_topic_tags'] ) && ( 1 === $_POST['bbp_topic_tags'] ) ) {
    15641564
    15651565        // Get the source topic tags
     
    16291629
    16301630            // New topic from reply can't be a reply to
    1631             if ( ( $from_reply->ID == $destination_topic->ID && $from_reply->ID == $reply_to ) ) {
     1631            if ( ( $from_reply->ID === $destination_topic->ID && $from_reply->ID === $reply_to ) ) {
    16321632                bbp_update_reply_to( $reply->ID, 0 );
    16331633            }
     
    16381638
    16391639        // Remove reply to from new topic
    1640         if ( $from_reply->ID == $destination_topic->ID ) {
     1640        if ( $from_reply->ID === $destination_topic->ID ) {
    16411641            delete_post_meta( $from_reply->ID, '_bbp_reply_to' );
    16421642        }
     
    16541654    // It is a new topic and we need to set some default metas to make
    16551655    // the topic display in bbp_has_topics() list
    1656     if ( 'reply' == $split_option ) {
     1656    if ( 'reply' === $split_option ) {
    16571657        bbp_update_topic_last_reply_id   ( $destination_topic->ID, $last_reply_id );
    16581658        bbp_update_topic_last_active_id  ( $destination_topic->ID, $last_reply_id );
     
    18431843
    18441844            // Attempting to merge a tag into itself
    1845             if ( $tag_id == $to_tag ) {
     1845            if ( $tag_id === $to_tag ) {
    18461846                bbp_add_error( 'bbp_manage_topic_tag_merge_same', __( '<strong>ERROR</strong>: The tags which are being merged can not be the same.', 'bbpress' ) );
    18471847                return;
     
    20092009
    20102010    // What is the user doing here?
    2011     if ( !current_user_can( 'edit_topic', $topic->ID ) || ( 'bbp_toggle_topic_trash' == $action && !current_user_can( 'delete_topic', $topic->ID ) ) ) {
     2011    if ( !current_user_can( 'edit_topic', $topic->ID ) || ( 'bbp_toggle_topic_trash' === $action && !current_user_can( 'delete_topic', $topic->ID ) ) ) {
    20122012        bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>ERROR:</strong> You do not have the permission to do that.', 'bbpress' ) );
    20132013        return;
     
    20322032
    20332033            $is_sticky = bbp_is_topic_sticky( $topic_id );
    2034             $is_super  = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && 1 == (int) $_GET['super'] ) ? true : false;
     2034            $is_super  = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && 1 === (int) $_GET['super'] ) ? true : false;
    20352035            $success   = $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
    20362036            $failure   = $is_sticky ? __( '<strong>ERROR</strong>: There was a problem unsticking the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem sticking the topic.', 'bbpress' );
     
    20912091
    20922092    // No errors
    2093     if ( false != $success && !is_wp_error( $success ) ) {
     2093    if ( false !== $success && !is_wp_error( $success ) ) {
    20942094
    20952095        // Redirect back to the topic's forum
    2096         if ( isset( $sub_action ) && ( 'delete' == $sub_action ) ) {
     2096        if ( isset( $sub_action ) && ( 'delete' === $sub_action ) ) {
    20972097            $redirect = bbp_get_forum_permalink( $success->post_parent );
    20982098
     
    24092409
    24102410    // Update only if published
    2411     if ( bbp_get_public_status_id() == get_post_status( $active_id ) ) {
     2411    if ( bbp_get_public_status_id() === get_post_status( $active_id ) ) {
    24122412        update_post_meta( $topic_id, '_bbp_last_active_id', (int) $active_id );
    24132413    }
     
    26402640
    26412641    // Bail if already closed
    2642     if ( bbp_get_closed_status_id() == $topic['post_status'] )
     2642    if ( bbp_get_closed_status_id() === $topic['post_status'] )
    26432643        return false;
    26442644
     
    26862686
    26872687    // Bail if already open
    2688     if ( bbp_get_closed_status_id() != $topic['post_status'])
     2688    if ( bbp_get_closed_status_id() !== $topic['post_status'])
    26892689        return false;
    26902690
     
    27342734
    27352735    // Bail if topic is spam
    2736     if ( bbp_get_spam_status_id() == $topic['post_status'] )
     2736    if ( bbp_get_spam_status_id() === $topic['post_status'] )
    27372737        return false;
    27382738
     
    28432843
    28442844    // Bail if already not spam
    2845     if ( bbp_get_spam_status_id() != $topic['post_status'] )
     2845    if ( bbp_get_spam_status_id() !== $topic['post_status'] )
    28462846        return false;
    28472847
  • trunk/includes/topics/template-tags.php

    r4987 r4995  
    148148
    149149    // Set post_parent back to 0 if originally set to 'any'
    150     if ( 'any' == $r['post_parent'] )
     150    if ( 'any' === $r['post_parent'] )
    151151        $r['post_parent'] = 0;
    152152
     
    270270
    271271    // If no limit to posts per page, set it to the current post_count
    272     if ( -1 == $r['posts_per_page'] )
     272    if ( -1 === $r['posts_per_page'] )
    273273        $r['posts_per_page'] = $bbp->topic_query->post_count;
    274274
     
    340340            'base'      => $base,
    341341            'format'    => '',
    342             'total'     => $r['posts_per_page'] == $bbp->topic_query->found_posts ? 1 : ceil( (int) $bbp->topic_query->found_posts / (int) $r['posts_per_page'] ),
     342            'total'     => $r['posts_per_page'] === $bbp->topic_query->found_posts ? 1 : ceil( (int) $bbp->topic_query->found_posts / (int) $r['posts_per_page'] ),
    343343            'current'   => (int) $bbp->topic_query->paged,
    344344            'prev_text' => is_rtl() ? '&rarr;' : '&larr;',
     
    486486
    487487    // Tweak the data type to return
    488     if ( $output == OBJECT ) {
     488    if ( $output === OBJECT ) {
    489489        return $topic;
    490490
    491     } elseif ( $output == ARRAY_A ) {
     491    } elseif ( $output === ARRAY_A ) {
    492492        $_topic = get_object_vars( $topic );
    493493        return $_topic;
    494494
    495     } elseif ( $output == ARRAY_N ) {
     495    } elseif ( $output === ARRAY_N ) {
    496496        $_topic = array_values( get_object_vars( $topic ) );
    497497        return $_topic;
     
    10591059     */
    10601060    function bbp_is_topic_closed( $topic_id = 0 ) {
    1061         $closed = bbp_get_topic_status( $topic_id ) == bbp_get_closed_status_id();
     1061        $closed = bbp_get_topic_status( $topic_id ) === bbp_get_closed_status_id();
    10621062        return (bool) apply_filters( 'bbp_is_topic_closed', (bool) $closed, $topic_id );
    10631063    }
     
    11181118 */
    11191119function bbp_is_topic_published( $topic_id = 0 ) {
    1120     $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) == bbp_get_public_status_id();
     1120    $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) === bbp_get_public_status_id();
    11211121    return (bool) apply_filters( 'bbp_is_topic_published', (bool) $topic_status, $topic_id );
    11221122}
     
    11341134 */
    11351135function bbp_is_topic_spam( $topic_id = 0 ) {
    1136     $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) == bbp_get_spam_status_id();
     1136    $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) === bbp_get_spam_status_id();
    11371137    return (bool) apply_filters( 'bbp_is_topic_spam', (bool) $topic_status, $topic_id );
    11381138}
     
    11501150 */
    11511151function bbp_is_topic_trash( $topic_id = 0 ) {
    1152     $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) == bbp_get_trash_status_id();
     1152    $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) === bbp_get_trash_status_id();
    11531153    return (bool) apply_filters( 'bbp_is_topic_trash', (bool) $topic_status, $topic_id );
    11541154}
     
    14291429
    14301430            // Get avatar
    1431             if ( 'avatar' == $r['type'] || 'both' == $r['type'] ) {
     1431            if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
    14321432                $author_links['avatar'] = bbp_get_topic_author_avatar( $topic_id, $r['size'] );
    14331433            }
    14341434
    14351435            // Get display name
    1436             if ( 'name' == $r['type'] || 'both' == $r['type'] ) {
     1436            if ( 'name' === $r['type'] || 'both' === $r['type'] ) {
    14371437                $author_links['name'] = bbp_get_topic_author_display_name( $topic_id );
    14381438            }
     
    18641864        $reply_id = bbp_get_topic_last_reply_id( $topic_id );
    18651865
    1866         if ( !empty( $reply_id ) && ( $reply_id != $topic_id ) ) {
     1866        if ( !empty( $reply_id ) && ( $reply_id !== $topic_id ) ) {
    18671867            $reply_url = bbp_get_reply_url( $reply_id );
    18681868        } else {
     
    26072607        $stick_uri = esc_url( wp_nonce_url( $stick_uri, 'stick-topic_' . $topic->ID ) );
    26082608
    2609         $stick_display = true == $is_sticky ? $r['unstick_text'] : $r['stick_text'];
     2609        $stick_display = true === $is_sticky ? $r['unstick_text'] : $r['stick_text'];
    26102610        $stick_display = '<a href="' . $stick_uri . '">' . $stick_display . '</a>';
    26112611
     
    36283628
    36293629            // Post author is not the current user
    3630             if ( bbp_get_current_user_id() != $post_author ) {
     3630            if ( bbp_get_current_user_id() !== $post_author ) {
    36313631                $topic_subscribed = bbp_is_user_subscribed( $post_author );
    36323632
  • trunk/includes/users/capabilities.php

    r4956 r4995  
    6969
    7070        // User already has this role so no new role is set
    71         if ( $new_role == $role ) {
     71        if ( $new_role === $role ) {
    7272            $new_role = false;
    7373
     
    193193
    194194    // Bail if no role change
    195     if ( $new_role == $forums_role )
     195    if ( $new_role === $forums_role )
    196196        return;
    197197
     
    281281
    282282    // Add the user to the site
    283     if ( true == $add_to_site ) {
     283    if ( true === $add_to_site ) {
    284284
    285285        // Make sure bbPress roles are added
  • trunk/includes/users/functions.php

    r4981 r4995  
    3232
    3333    // $url was manually set in wp-login.php to redirect to admin
    34     elseif ( admin_url() == $url )
     34    elseif ( admin_url() === $url )
    3535        $url = home_url();
    3636
     
    473473    $success     = false;
    474474
    475     if ( true == $is_favorite && 'bbp_favorite_remove' == $action )
     475    if ( true === $is_favorite && 'bbp_favorite_remove' === $action )
    476476        $success = bbp_remove_user_favorite( $user_id, $topic_id );
    477     elseif ( false == $is_favorite && 'bbp_favorite_add' == $action )
     477    elseif ( false === $is_favorite && 'bbp_favorite_add' === $action )
    478478        $success = bbp_add_user_favorite( $user_id, $topic_id );
    479479
     
    482482
    483483    // Success!
    484     if ( true == $success ) {
     484    if ( true === $success ) {
    485485
    486486        // Redirect back from whence we came
     
    503503
    504504    // Fail! Handle errors
    505     } elseif ( true == $is_favorite && 'bbp_favorite_remove' == $action ) {
     505    } elseif ( true === $is_favorite && 'bbp_favorite_remove' === $action ) {
    506506        bbp_add_error( 'bbp_favorite_remove', __( '<strong>ERROR</strong>: There was a problem removing that topic from favorites!', 'bbpress' ) );
    507     } elseif ( false == $is_favorite && 'bbp_favorite_add' == $action ) {
     507    } elseif ( false === $is_favorite && 'bbp_favorite_add' === $action ) {
    508508        bbp_add_error( 'bbp_favorite_add',    __( '<strong>ERROR</strong>: There was a problem favoriting that topic!', 'bbpress' ) );
    509509    }
     
    786786    $success         = false;
    787787
    788     if ( true == $is_subscription && 'bbp_unsubscribe' == $action )
     788    if ( true === $is_subscription && 'bbp_unsubscribe' === $action )
    789789        $success = bbp_remove_user_subscription( $user_id, $topic_id );
    790     elseif ( false == $is_subscription && 'bbp_subscribe' == $action )
     790    elseif ( false === $is_subscription && 'bbp_subscribe' === $action )
    791791        $success = bbp_add_user_subscription( $user_id, $topic_id );
    792792
     
    795795
    796796    // Success!
    797     if ( true == $success ) {
     797    if ( true === $success ) {
    798798
    799799        // Redirect back from whence we came
     
    816816
    817817    // Fail! Handle errors
    818     } elseif ( true == $is_subscription && 'bbp_unsubscribe' == $action ) {
     818    } elseif ( true === $is_subscription && 'bbp_unsubscribe' === $action ) {
    819819        bbp_add_error( 'bbp_unsubscribe', __( '<strong>ERROR</strong>: There was a problem unsubscribing from that topic!', 'bbpress' ) );
    820     } elseif ( false == $is_subscription && 'bbp_subscribe' == $action ) {
     820    } elseif ( false === $is_subscription && 'bbp_subscribe' === $action ) {
    821821        bbp_add_error( 'bbp_subscribe',    __( '<strong>ERROR</strong>: There was a problem subscribing to that topic!', 'bbpress' ) );
    822822    }
     
    868868        $new_email = get_option( $user_id . '_new_email' );
    869869
    870         if ( $new_email['hash'] == $_GET['newuseremail'] ) {
     870        if ( $new_email['hash'] === $_GET['newuseremail'] ) {
    871871            $user             = new stdClass();
    872872            $user->ID         = $user_id;
     
    887887
    888888    // Delete new email address from user options
    889     } elseif ( is_multisite() && bbp_is_user_home_edit() && !empty( $_GET['dismiss'] ) && ( $user_id . '_new_email' == $_GET['dismiss'] ) ) {
     889    } elseif ( is_multisite() && bbp_is_user_home_edit() && !empty( $_GET['dismiss'] ) && ( $user_id . '_new_email' === $_GET['dismiss'] ) ) {
    890890        delete_option( $user_id . '_new_email' );
    891891        wp_safe_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) );
  • trunk/includes/users/options.php

    r4957 r4995  
    153153
    154154        $count  = (int) get_user_option( '_bbp_topic_count', $user_id );
    155         $filter = ( false == $integer ) ? 'bbp_get_user_topic_count_int' : 'bbp_get_user_topic_count';
     155        $filter = ( false === $integer ) ? 'bbp_get_user_topic_count_int' : 'bbp_get_user_topic_count';
    156156
    157157        return apply_filters( $filter, $count, $user_id );
     
    191191
    192192        $count  = (int) get_user_option( '_bbp_reply_count', $user_id );
    193         $filter = ( true == $integer ) ? 'bbp_get_user_topic_count_int' : 'bbp_get_user_topic_count';
     193        $filter = ( true === $integer ) ? 'bbp_get_user_topic_count_int' : 'bbp_get_user_topic_count';
    194194
    195195        return apply_filters( $filter, $count, $user_id );
     
    231231        $replies = bbp_get_user_reply_count( $user_id, true );
    232232        $count   = (int) $topics + $replies;
    233         $filter  = ( true == $integer ) ? 'bbp_get_user_post_count_int' : 'bbp_get_user_post_count';
     233        $filter  = ( true === $integer ) ? 'bbp_get_user_post_count_int' : 'bbp_get_user_post_count';
    234234
    235235        return apply_filters( $filter, $count, $user_id );
  • trunk/includes/users/template-tags.php

    r4984 r4995  
    12371237
    12381238    // loggedout was passed
    1239     if ( !empty( $_GET['loggedout'] ) && ( true == $_GET['loggedout'] ) ) {
     1239    if ( !empty( $_GET['loggedout'] ) && ( true === $_GET['loggedout'] ) ) {
    12401240        bbp_add_error( 'loggedout', __( 'You are now logged out.', 'bbpress' ), 'message' );
    12411241
    12421242    // registration is disabled
    1243     } elseif ( !empty( $_GET['registration'] ) && ( 'disabled' == $_GET['registration'] ) ) {
     1243    } elseif ( !empty( $_GET['registration'] ) && ( 'disabled' === $_GET['registration'] ) ) {
    12441244        bbp_add_error( 'registerdisabled', __( 'New user registration is currently not allowed.', 'bbpress' ) );
    12451245
     
    14451445
    14461446            // Get avatar
    1447             if ( 'avatar' == $r['type'] || 'both' == $r['type'] ) {
     1447            if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
    14481448                $author_links[] = get_avatar( $user_id, $r['size'] );
    14491449            }
    14501450
    14511451            // Get display name
    1452             if ( 'name' == $r['type'] || 'both' == $r['type'] ) {
     1452            if ( 'name' === $r['type'] || 'both' === $r['type'] ) {
    14531453                $author_links[] = get_the_author_meta( 'display_name', $user_id );
    14541454            }
  • trunk/templates/default/bbpress/form-user-edit.php

    r4980 r4995  
    109109            // Handle address change requests
    110110            $new_email = get_option( bbp_get_displayed_user_id() . '_new_email' );
    111             if ( $new_email && $new_email != bbp_get_displayed_user_field( 'user_email', 'edit' ) ) : ?>
     111            if ( !empty( $new_email ) && $new_email !== bbp_get_displayed_user_field( 'user_email', 'edit' ) ) : ?>
    112112
    113113                <span class="updated inline">
  • trunk/templates/default/bbpress/loop-single-topic.php

    r4948 r4995  
    6262            <?php do_action( 'bbp_theme_after_topic_started_by' ); ?>
    6363
    64             <?php if ( !bbp_is_single_forum() || ( bbp_get_topic_forum_id() != bbp_get_forum_id() ) ) : ?>
     64            <?php if ( !bbp_is_single_forum() || ( bbp_get_topic_forum_id() !== bbp_get_forum_id() ) ) : ?>
    6565
    6666                <?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
Note: See TracChangeset for help on using the changeset viewer.