Changeset 4995
- Timestamp:
- 06/23/2013 06:37:22 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/admin.php
r4969 r4995 485 485 486 486 // Return normal links if not bbPress 487 if ( plugin_basename( bbpress()->file ) != $file )487 if ( plugin_basename( bbpress()->file ) !== $file ) 488 488 return $links; 489 489 … … 558 558 $reply_class = sanitize_html_class( bbp_get_reply_post_type() ); 559 559 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 ) ) : ?> 561 561 562 562 <script type="text/javascript"> … … 828 828 } 829 829 830 <?php if ( 'bbpress' == get_user_option( 'admin_color' ) ) : ?>830 <?php if ( 'bbpress' === get_user_option( 'admin_color' ) ) : ?> 831 831 832 832 /* Green Scheme Images */ -
trunk/includes/admin/metaboxes.php
r4950 r4995 154 154 $text = _n( 'Hidden Topic', 'Hidden Topics', $r['topic_count_hidden'], 'bbpress' ); 155 155 $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 ) { 157 157 $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link ); 158 158 } … … 176 176 $text = _n( 'Hidden Reply', 'Hidden Replies', $r['reply_count_hidden'], 'bbpress' ); 177 177 $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 ) { 179 179 $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link ); 180 180 } -
trunk/includes/admin/replies.php
r4991 r4995 99 99 */ 100 100 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 ) ) 102 102 return true; 103 103 … … 339 339 340 340 // Bail if post_type is not a reply 341 if ( empty( $_GET['action'] ) || ( 'edit' != $_GET['action'] ) )341 if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) ) 342 342 return; 343 343 … … 478 478 $message = array( 'bbp_reply_toggle_notice' => $message, 'reply_id' => $reply->ID ); 479 479 480 if ( false == $success || is_wp_error( $success ) )480 if ( false === $success || is_wp_error( $success ) ) 481 481 $message['failed'] = '1'; 482 482 … … 530 530 switch ( $notice ) { 531 531 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 ); 533 533 break; 534 534 535 535 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 ); 537 537 break; 538 538 } … … 543 543 ?> 544 544 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"> 546 546 <p style="line-height: 150%"><?php echo esc_html( $message ); ?></p> 547 547 </div> … … 654 654 655 655 // Alert capable users of reply forum mismatch 656 if ( $reply_forum_id != $topic_forum_id ) {656 if ( $reply_forum_id !== $topic_forum_id ) { 657 657 if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) { 658 658 $forum_title .= '<div class="attention">' . esc_html__( '(Mismatch)', 'bbpress' ) . '</div>'; … … 727 727 728 728 // 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' ) ) 730 730 unset( $actions['view'] ); 731 731 … … 744 744 // Trash 745 745 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 ) { 747 747 $post_type_object = get_post_type_object( bbp_get_reply_post_type() ); 748 748 $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 . '&action=untrash', $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>"; … … 751 751 } 752 752 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 ) { 754 754 $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 ) { 756 756 unset( $actions['trash'] ); 757 757 } … … 776 776 777 777 // 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' ) ) { 779 779 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 780 780 $title = esc_attr__( 'Empty Spam', 'bbpress' ); -
trunk/includes/admin/settings.php
r4971 r4995 1749 1749 1750 1750 // Compare 1751 if ( ( $slug != $key ) && ( $slug_check== $this_slug ) ) : ?>1751 if ( ( $slug !== $key ) && ( $slug_check === $this_slug ) ) : ?> 1752 1752 1753 1753 <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 91 91 92 92 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] ) ) { 94 94 $messages[] = call_user_func( $item[2] ); 95 95 } … … 402 402 403 403 // 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 ) { 405 405 wp_update_post( array( 406 406 'ID' => $posts[0]->ID, … … 910 910 // If the topic is not a super sticky, and the forum ID does not 911 911 // 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 ) ) { 913 913 unset( $forum_stickies[$forum_id][$id] ); 914 914 } … … 1206 1206 $statement = __( 'Deleting Conversion Table… %s', 'bbpress' ); 1207 1207 $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 ) { 1209 1209 $wpdb->query( "DROP TABLE {$table_name}" ); 1210 1210 $result = $success; -
trunk/includes/admin/topics.php
r4991 r4995 99 99 */ 100 100 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 ) ) 102 102 return true; 103 103 … … 355 355 356 356 // Bail if post_type is not a topic 357 if ( empty( $_GET['action'] ) || ( 'edit' != $_GET['action'] ) )357 if ( empty( $_GET['action'] ) || ( 'edit' !== $_GET['action'] ) ) 358 358 return; 359 359 … … 493 493 494 494 $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 ); 497 497 498 498 break; … … 502 502 503 503 $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 ); 508 508 509 509 break; … … 513 513 514 514 $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 ); 517 517 518 518 break; … … 521 521 $message = array( 'bbp_topic_toggle_notice' => $message, 'topic_id' => $topic->ID ); 522 522 523 if ( false == $success || is_wp_error( $success ) )523 if ( false === $success || is_wp_error( $success ) ) 524 524 $message['failed'] = '1'; 525 525 … … 573 573 switch ( $notice ) { 574 574 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 ); 576 576 break; 577 577 578 578 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 ); 580 580 break; 581 581 582 582 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 ); 584 584 break; 585 585 586 586 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 ); 588 588 break; 589 589 590 590 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 ); 592 592 break; 593 593 594 594 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 ); 596 596 break; 597 597 598 598 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 ); 600 600 break; 601 601 } … … 606 606 ?> 607 607 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"> 609 609 <p style="line-height: 150%"><?php echo esc_html( $message ); ?></p> 610 610 </div> … … 774 774 775 775 // 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' ) ) 777 777 $actions['view'] = '<a href="' . bbp_get_topic_permalink( $topic->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”', 'bbpress' ), bbp_get_topic_title( $topic->ID ) ) ) . '" rel="permalink">' . esc_html__( 'View', 'bbpress' ) . '</a>'; 778 778 … … 814 814 // Do not show trash links for spam topics, or spam links for trashed topics 815 815 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 ) { 817 817 $post_type_object = get_post_type_object( bbp_get_topic_post_type() ); 818 818 $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 . '&action=untrash', $topic->ID ) ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>"; … … 821 821 } 822 822 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 ) { 824 824 $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 ) { 826 826 unset( $actions['trash'] ); 827 827 } … … 846 846 847 847 // 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' ) ) { 849 849 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 850 850 $title = esc_attr__( 'Empty Spam', 'bbpress' ); -
trunk/includes/admin/users.php
r4950 r4995 182 182 183 183 // Don't let a user change their own role 184 if ( $user_id == $current_user_id )184 if ( $user_id === $current_user_id ) 185 185 continue; 186 186 … … 194 194 195 195 // Set the new forums role 196 if ( $new_role != $user_role ) {196 if ( $new_role !== $user_role ) { 197 197 bbp_set_user_role( $user_id, $new_role ); 198 198 } … … 230 230 231 231 // Only looking for bbPress's user role column 232 if ( 'bbp_user_role' == $column_name ) {232 if ( 'bbp_user_role' === $column_name ) { 233 233 234 234 // Get the users role -
trunk/includes/common/classes.php
r4944 r4995 242 242 // - the forum is a category 243 243 // - 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 ) 246 246 && ( bbp_is_forum_category( $_post->ID ) 247 247 || ( !current_user_can( 'edit_forum', $_post->ID ) && bbp_is_forum_closed( $_post->ID ) -
trunk/includes/common/formatting.php
r4942 r4995 187 187 188 188 // Trim inline code, not pre blocks (to prevent removing indentation) 189 if ( "`" == $matches[1] ) {189 if ( "`" === $matches[1] ) { 190 190 $content = trim( $matches[2] ); 191 191 } else { … … 205 205 206 206 // Wrap blocks in pre tags 207 if ( "`" != $matches[1] ) {207 if ( "`" !== $matches[1] ) { 208 208 $content = '<pre>' . $content . '</pre>'; 209 209 } … … 333 333 } 334 334 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) ) ) { 336 336 $r .= $piece; 337 337 continue; -
trunk/includes/common/functions.php
r4916 r4995 153 153 // Finding the biggest chunk (if the chunk fits, break) 154 154 $count = floor( $since / $seconds ); 155 if ( 0 != $count ) {155 if ( 0 !== $count ) { 156 156 break; 157 157 } … … 165 165 166 166 // 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]; 168 168 169 169 // Step two: the second chunk … … 174 174 175 175 // 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]; 178 178 } 179 179 } … … 187 187 188 188 // Append 'ago' to the end of time-since if not 'right now' 189 if ( $output != $right_now_text ) {189 if ( $output !== $right_now_text ) { 190 190 $output = sprintf( $ago_text, $output ); 191 191 } … … 218 218 219 219 // We add our own full stop. 220 while ( substr( $reason, -1 ) == '.' )220 while ( substr( $reason, -1 ) === '.' ) 221 221 $reason = substr( $reason, 0, -1 ); 222 222 … … 291 291 */ 292 292 function 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 ) ) ); 294 294 return apply_filters( 'bbp_get_view_all', (bool) $retval ); 295 295 } … … 351 351 352 352 // 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'] ) ) ) 355 355 return $data; 356 356 … … 1062 1062 1063 1063 // 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 ) 1065 1065 continue; 1066 1066 … … 1124 1124 1125 1125 // 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'] ) ) ) { 1127 1127 $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; 1128 1128 } … … 1257 1257 1258 1258 // 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() ) { 1260 1260 $post_status[] = bbp_get_closed_status_id(); 1261 1261 } … … 1302 1302 1303 1303 // 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() ) { 1305 1305 $post_status[] = bbp_get_closed_status_id(); 1306 1306 } … … 1347 1347 1348 1348 // 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() ) { 1350 1350 $post_status[] = bbp_get_closed_status_id(); 1351 1351 } … … 1553 1553 1554 1554 // 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'] ) ) { 1556 1556 1557 1557 // The query … … 1571 1571 1572 1572 // 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'] ) ) { 1574 1574 1575 1575 // The query -
trunk/includes/common/template-tags.php
r4989 r4995 129 129 130 130 // 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 ) ) ) 132 132 $retval = true; 133 133 … … 201 201 202 202 // 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 ) ) 204 204 $retval = true; 205 205 206 206 // 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'] ) ) ) 208 208 $retval = true; 209 209 … … 227 227 228 228 // 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 ) ) ) 230 230 $retval = true; 231 231 … … 298 298 299 299 // 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 ) ) 301 301 $retval = true; 302 302 303 303 // 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'] ) ) ) 305 305 $retval = true; 306 306 … … 322 322 323 323 // 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'] ) ) 325 325 return true; 326 326 … … 342 342 343 343 // 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'] ) ) 345 345 $retval = true; 346 346 … … 394 394 395 395 // 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 ) ) 397 397 $retval = true; 398 398 399 399 // 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'] ) ) ) 401 401 $retval = true; 402 402 … … 449 449 450 450 // 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 ) ) ) 452 452 $retval = true; 453 453 … … 470 470 471 471 // 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 ) ) 473 473 $retval = true; 474 474 475 475 // 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'] ) ) ) 477 477 $retval = true; 478 478 … … 492 492 493 493 // 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'] ) ) 495 495 $retval = true; 496 496 … … 540 540 541 541 // 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 ) ) 543 543 $retval = true; 544 544 … … 560 560 561 561 // 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 ) ) 563 563 $retval = true; 564 564 … … 581 581 582 582 // 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 ) ) 584 584 $retval = true; 585 585 … … 602 602 603 603 // 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 ) ) 605 605 $retval = true; 606 606 … … 625 625 626 626 // 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 ) ) 628 628 $retval = true; 629 629 … … 667 667 668 668 // 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 ) ) 670 670 $retval = true; 671 671 … … 688 688 689 689 // 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 ) ) 691 691 $retval = true; 692 692 … … 709 709 710 710 // 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 ) ) 712 712 $retval = true; 713 713 … … 730 730 731 731 // 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 ) ) 733 733 $retval = true; 734 734 … … 751 751 752 752 // 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 ) ) 754 754 $retval = true; 755 755 … … 773 773 774 774 // 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 ) ) 776 776 $retval = true; 777 777 … … 803 803 804 804 // 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 ) ) 806 806 $retval = true; 807 807 … … 866 866 867 867 // 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 ) ) 869 869 $retval = true; 870 870 … … 1400 1400 1401 1401 // Forums 1402 if ( bbp_get_forum_post_type() == $r['post_type'] ) {1402 if ( bbp_get_forum_post_type() === $r['post_type'] ) { 1403 1403 1404 1404 // Private forums … … 1826 1826 // Unset fullscreen 1827 1827 foreach ( $plugins as $key => $value ) { 1828 if ( 'fullscreen' == $value ) {1828 if ( 'fullscreen' === $value ) { 1829 1829 unset( $plugins[$key] ); 1830 1830 break; … … 2017 2017 */ 2018 2018 function bbp_is_query_name( $name = '' ) { 2019 return (bool) ( bbp_get_query_name() == $name );2019 return (bool) ( bbp_get_query_name() === $name ); 2020 2020 } 2021 2021 … … 2151 2151 2152 2152 // 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 ) ) { 2154 2154 $pre_include_root = false; 2155 2155 } … … 2161 2161 2162 2162 // 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() ) ) ) { 2164 2164 $pre_include_root = false; 2165 2165 } … … 2440 2440 // Loop through notices and separate errors from messages 2441 2441 foreach ( $bbp->errors->get_error_messages( $code ) as $error ) { 2442 if ( 'message' == $severity ) {2442 if ( 'message' === $severity ) { 2443 2443 $messages[] = $error; 2444 2444 } else { … … 2609 2609 2610 2610 // Compare new title with original title 2611 if ( $title == $_title )2611 if ( $title === $_title ) 2612 2612 return $title; 2613 2613 … … 2620 2620 2621 2621 // sep on right, so reverse the order 2622 if ( 'right' == $seplocation ) {2622 if ( 'right' === $seplocation ) { 2623 2623 $title_array = array_reverse( explode( $t_sep, $title ) ); 2624 2624 $title = implode( " $sep ", $title_array ) . $prefix; -
trunk/includes/common/widgets.php
r4971 r4995 804 804 805 805 // Maybe get the topic author 806 if ( 'on' == $settings['show_user'] ) :806 if ( 'on' === $settings['show_user'] ) : 807 807 $author_link = bbp_get_topic_author_link( array( 'post_id' => $topic_id, 'type' => 'both', 'size' => 14 ) ); 808 808 endif; ?> … … 817 817 <?php endif; ?> 818 818 819 <?php if ( 'on' == $settings['show_date'] ) : ?>819 <?php if ( 'on' === $settings['show_date'] ) : ?> 820 820 821 821 <div><?php bbp_topic_last_active_time( $topic_id ); ?></div> … … 1155 1155 1156 1156 // Only query user if showing them 1157 if ( 'on' == $settings['show_user'] ) :1157 if ( 'on' === $settings['show_user'] ) : 1158 1158 $author_link = bbp_get_reply_author_link( array( 'post_id' => $reply_id, 'type' => 'both', 'size' => 14 ) ); 1159 1159 else : … … 1162 1162 1163 1163 // Reply author, link, and timestamp 1164 if ( ( 'on' == $settings['show_date'] ) && !empty( $author_link ) ) :1164 if ( ( 'on' === $settings['show_date'] ) && !empty( $author_link ) ) : 1165 1165 1166 1166 // translators: 1: reply author, 2: reply link, 3: reply timestamp … … 1168 1168 1169 1169 // Reply link and timestamp 1170 elseif ( 'on' == $settings['show_date'] ) :1170 elseif ( 'on' === $settings['show_date'] ) : 1171 1171 1172 1172 // translators: 1: reply link, 2: reply timestamp -
trunk/includes/core/capabilities.php
r4859 r4995 475 475 476 476 // If keys match, unset 477 if ( $wp_role == $bbp_role ) {477 if ( $wp_role === $bbp_role ) { 478 478 unset( $all_roles[$wp_role] ); 479 479 } -
trunk/includes/core/functions.php
r4927 r4995 551 551 */ 552 552 function bbp_is_post_request() { 553 return (bool) ( 'POST' == strtoupper( $_SERVER['REQUEST_METHOD'] ) );553 return (bool) ( 'POST' === strtoupper( $_SERVER['REQUEST_METHOD'] ) ); 554 554 } 555 555 … … 561 561 */ 562 562 function 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 102 102 103 103 // Maybe load the template if one was located 104 if ( ( true == $load ) && !empty( $located ) ) {104 if ( ( true === $load ) && !empty( $located ) ) { 105 105 load_template( $located, $require_once ); 106 106 } … … 316 316 317 317 // Bail if filters are suppressed on this query 318 if ( true == $posts_query->get( 'suppress_filters' ) )318 if ( true === $posts_query->get( 'suppress_filters' ) ) 319 319 return; 320 320 … … 422 422 423 423 // 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 ) { 425 425 $posts_query->bbp_is_single_user_home = true; 426 426 } -
trunk/includes/core/theme-compat.php
r4976 r4995 259 259 return false; 260 260 261 return (bool) ( $bbp->theme_compat->original_template == $template );261 return (bool) ( $bbp->theme_compat->original_template === $template ); 262 262 } 263 263 -
trunk/includes/core/update.php
r4910 r4995 54 54 $action = false; 55 55 56 if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {56 if ( ! empty( $_REQUEST['action'] ) && ( '-1' !== $_REQUEST['action'] ) ) { 57 57 $action = $_REQUEST['action']; 58 } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {58 } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' !== $_REQUEST['action2'] ) ) { 59 59 $action = $_REQUEST['action2']; 60 60 } … … 66 66 67 67 // The plugin(s) being activated 68 if ( $action == 'activate' ) {68 if ( $action === 'activate' ) { 69 69 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); 70 70 } else { … … 96 96 $action = false; 97 97 98 if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {98 if ( ! empty( $_REQUEST['action'] ) && ( '-1' !== $_REQUEST['action'] ) ) { 99 99 $action = $_REQUEST['action']; 100 } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {100 } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' !== $_REQUEST['action2'] ) ) { 101 101 $action = $_REQUEST['action2']; 102 102 } … … 108 108 109 109 // The plugin(s) being deactivated 110 if ( $action == 'deactivate' ) {110 if ( $action === 'deactivate' ) { 111 111 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); 112 112 } else { -
trunk/includes/extend/akismet.php
r4959 r4995 98 98 99 99 // 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'] ) 101 101 return $post_data; 102 102 … … 166 166 167 167 // Spam 168 if ( 'true' == $post_data['bbp_akismet_result'] ) {168 if ( 'true' === $post_data['bbp_akismet_result'] ) { 169 169 170 170 // Let plugins do their thing … … 255 255 256 256 // 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 ) ) 258 258 return; 259 259 … … 385 385 386 386 // Aim... 387 if ( 'check' == $check ) {387 if ( 'check' === $check ) { 388 388 $path = '/1.1/comment-check'; 389 } elseif ( 'submit' == $check ) {389 } elseif ( 'submit' === $check ) { 390 390 $path = '/1.1/submit-' . $spam; 391 391 } … … 446 446 447 447 // 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 ) 451 451 ) { 452 452 453 453 // Normal result: true 454 if ( $this->last_post['bbp_akismet_result'] == 'true' ) {454 if ( $this->last_post['bbp_akismet_result'] === 'true' ) { 455 455 456 456 // Leave a trail so other's know what we did … … 459 459 460 460 // 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 ) { 462 462 $this->update_post_history( $post_id, sprintf( esc_html__( 'Post status was changed to %s', 'bbpress' ), $_post->post_status ), 'status-changed-' . $_post->post_status ); 463 463 } 464 464 465 465 // Normal result: false 466 } elseif ( $this->last_post['bbp_akismet_result'] == 'false' ) {466 } elseif ( $this->last_post['bbp_akismet_result'] === 'false' ) { 467 467 468 468 // Leave a trail so other's know what we did … … 471 471 472 472 // 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 ) { 474 474 475 475 // @todo Use wp_blacklist_check() … … 661 661 662 662 // 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 ) ) ) { 664 664 665 665 // Write our request to the pointer -
trunk/includes/extend/buddypress/activity.php
r4959 r4995 632 632 633 633 // 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 ) { 635 635 636 636 // Validate reply data -
trunk/includes/extend/buddypress/functions.php
r4733 r4995 39 39 40 40 // Currently viewing or editing a user 41 elseif ( ( true == $displayed_user_fallback ) && !empty( $did ) )41 elseif ( ( true === $displayed_user_fallback ) && !empty( $did ) ) 42 42 $bbp_user_id = $did; 43 43 44 44 // Maybe fallback on the current_user ID 45 elseif ( ( true == $current_user_fallback ) && !empty( $lid ) )45 elseif ( ( true === $current_user_fallback ) && !empty( $lid ) ) 46 46 $bbp_user_id = $lid; 47 47 -
trunk/includes/extend/buddypress/group.php
r4959 r4995 792 792 793 793 // 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() ) : 795 795 796 796 // Unset the super sticky link on edit topic template … … 805 805 806 806 // Merge 807 if ( !empty( $_GET['action'] ) && 'merge' == $_GET['action'] ) :807 if ( !empty( $_GET['action'] ) && 'merge' === $_GET['action'] ) : 808 808 bbp_set_query_name( 'bbp_topic_merge' ); 809 809 bbp_get_template_part( 'form', 'topic-merge' ); 810 810 811 811 // Split 812 elseif ( !empty( $_GET['action'] ) && 'split' == $_GET['action'] ) :812 elseif ( !empty( $_GET['action'] ) && 'split' === $_GET['action'] ) : 813 813 bbp_set_query_name( 'bbp_topic_split' ); 814 814 bbp_get_template_part( 'form', 'topic-split' ); … … 851 851 <h3><?php bbp_reply_title(); ?></h3> 852 852 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() ) : 854 854 855 855 // Set the edit switches … … 861 861 862 862 // Move 863 if ( !empty( $_GET['action'] ) && ( 'move' == $_GET['action'] ) ) :863 if ( !empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) ) : 864 864 bbp_set_query_name( 'bbp_reply_move' ); 865 865 bbp_get_template_part( 'form', 'reply-move' ); -
trunk/includes/forums/capabilities.php
r4835 r4995 78 78 79 79 // Post is public 80 if ( bbp_get_public_status_id() == $_post->post_status ) {80 if ( bbp_get_public_status_id() === $_post->post_status ) { 81 81 $caps = array( 'spectate' ); 82 82 83 83 // User is author so allow read 84 } elseif ( (int) $user_id == (int) $_post->post_author ) {84 } elseif ( (int) $user_id === (int) $_post->post_author ) { 85 85 $caps = array( 'spectate' ); 86 86 … … 138 138 139 139 // User is author so allow edit 140 } elseif ( (int) $user_id == (int) $_post->post_author ) {140 } elseif ( (int) $user_id === (int) $_post->post_author ) { 141 141 $caps[] = $post_type->cap->edit_posts; 142 142 … … 167 167 168 168 // 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 ) { 170 170 $caps[] = $post_type->cap->delete_posts; 171 171 -
trunk/includes/forums/functions.php
r4990 r4995 137 137 138 138 // 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'] ) { 140 140 remove_filter( 'bbp_new_forum_pre_title', 'wp_filter_kses' ); 141 141 remove_filter( 'bbp_new_forum_pre_content', 'bbp_encode_bad', 10 ); … … 258 258 // If the forum is trash, or the forum_status is switched to 259 259 // 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() ) ) { 261 261 262 262 // Trash the reply … … 270 270 271 271 // 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() ) { 273 273 add_post_meta( $forum_id, '_bbp_spam_meta_status', bbp_get_public_status_id() ); 274 274 … … 407 407 408 408 // 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'] ) ) { 410 410 remove_filter( 'bbp_edit_forum_pre_title', 'wp_filter_kses' ); 411 411 remove_filter( 'bbp_edit_forum_pre_content', 'bbp_encode_bad', 10 ); … … 509 509 510 510 // 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 ) ) ) { 512 512 bbp_update_forum_revision_log( array( 513 513 'forum_id' => $forum_id, … … 539 539 // as the first arg and new forum parent id as the second. 540 540 // @todo implement 541 //if ( $forum_id != $forum->post_parent )541 //if ( $forum_id !== $forum->post_parent ) 542 542 // bbp_move_forum_handler( $forum_parent_id, $forum->post_parent, $forum_id ); 543 543 … … 612 612 613 613 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 ) ) { 615 615 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 ) ) { 617 617 bbp_open_forum( $forum_id ); 618 618 } … … 622 622 623 623 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 ) ) { 625 625 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 ) ) { 627 627 bbp_normalize_forum( $forum_id ); 628 628 } … … 799 799 800 800 // 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 ) { 802 802 803 803 // Update forum post_status … … 828 828 829 829 // 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 ) { 831 831 832 832 // Get hidden forums … … 877 877 878 878 // 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 ) { 880 880 881 881 // Get private forums … … 1226 1226 1227 1227 // 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 ) ) 1229 1229 update_post_meta( $forum_id, '_bbp_last_active_id', (int) $active_id ); 1230 1230 … … 1476 1476 } 1477 1477 1478 if ( bbp_get_public_status_id() == $r['last_active_status'] ) {1478 if ( bbp_get_public_status_id() === $r['last_active_status'] ) { 1479 1479 bbp_update_forum_last_active_time( $r['forum_id'], $r['last_active_time'] ); 1480 1480 } … … 1642 1642 1643 1643 // Bail if filters are suppressed on this query 1644 if ( true == $posts_query->get( 'suppress_filters' ) ) {1644 if ( true === $posts_query->get( 'suppress_filters' ) ) { 1645 1645 return; 1646 1646 } -
trunk/includes/forums/template-tags.php
r4952 r4995 206 206 207 207 // Tweak the data type to return 208 if ( $output == OBJECT ) {208 if ( $output === OBJECT ) { 209 209 return $forum; 210 210 211 } elseif ( $output == ARRAY_A ) {211 } elseif ( $output === ARRAY_A ) { 212 212 $_forum = get_object_vars( $forum ); 213 213 return $_forum; 214 214 215 } elseif ( $output == ARRAY_N ) {215 } elseif ( $output === ARRAY_N ) { 216 216 $_forum = array_values( get_object_vars( $forum ) ); 217 217 return $_forum; … … 1433 1433 $forum_id = bbp_get_forum_id( $forum_id ); 1434 1434 $type = bbp_get_forum_type( $forum_id ); 1435 $retval = ( !empty( $type ) && 'category' == $type );1435 $retval = ( !empty( $type ) && 'category' === $type ); 1436 1436 1437 1437 return (bool) apply_filters( 'bbp_is_forum_category', (bool) $retval, $forum_id ); … … 1469 1469 1470 1470 $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 ) ); 1472 1472 1473 1473 if ( !empty( $check_ancestors ) ) { … … 1504 1504 1505 1505 // If post status is public, return true 1506 $retval = ( bbp_get_public_status_id() == $visibility );1506 $retval = ( bbp_get_public_status_id() === $visibility ); 1507 1507 1508 1508 // Check ancestors and inherit their privacy setting for display … … 1540 1540 1541 1541 // If post status is private, return true 1542 $retval = ( bbp_get_private_status_id() == $visibility );1542 $retval = ( bbp_get_private_status_id() === $visibility ); 1543 1543 1544 1544 // Check ancestors and inherit their privacy setting for display … … 1576 1576 1577 1577 // If post status is private, return true 1578 $retval = ( bbp_get_hidden_status_id() == $visibility );1578 $retval = ( bbp_get_hidden_status_id() === $visibility ); 1579 1579 1580 1580 // Check ancestors and inherit their privacy setting for display -
trunk/includes/replies/capabilities.php
r4835 r4995 67 67 68 68 // Post is public 69 if ( bbp_get_public_status_id() == $_post->post_status ) {69 if ( bbp_get_public_status_id() === $_post->post_status ) { 70 70 $caps = array( 'spectate' ); 71 71 72 72 // User is author so allow read 73 } elseif ( (int) $user_id == (int) $_post->post_author ) {73 } elseif ( (int) $user_id === (int) $_post->post_author ) { 74 74 $caps = array( 'spectate' ); 75 75 … … 127 127 128 128 // User is author so allow edit 129 } elseif ( (int) $user_id == (int) $_post->post_author ) {129 } elseif ( (int) $user_id === (int) $_post->post_author ) { 130 130 $caps[] = $post_type->cap->edit_posts; 131 131 -
trunk/includes/replies/functions.php
r4992 r4995 210 210 211 211 // 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'] ) { 213 213 remove_filter( 'bbp_new_reply_pre_title', 'wp_filter_kses' ); 214 214 remove_filter( 'bbp_new_reply_pre_content', 'bbp_encode_bad', 10 ); … … 336 336 // If this reply starts as trash, add it to pre_trashed_replies 337 337 // 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() ) ) { 339 339 340 340 // Trash the reply … … 357 357 358 358 // 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() ) ) { 360 360 add_post_meta( $reply_id, '_bbp_spam_meta_status', bbp_get_public_status_id() ); 361 361 … … 501 501 502 502 // 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'] ) { 504 504 remove_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' ); 505 505 remove_filter( 'bbp_edit_reply_pre_content', 'bbp_encode_bad', 10 ); … … 580 580 581 581 // 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 ) { 583 583 $reply_status = bbp_get_pending_status_id(); 584 584 } … … 661 661 662 662 // 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'] ) ) { 664 664 $revision_id = wp_save_post_revision( $reply_id ); 665 665 if ( !empty( $revision_id ) ) { … … 795 795 if ( bbp_is_subscriptions_active() && !empty( $author_id ) && !empty( $topic_id ) ) { 796 796 $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; 798 798 799 799 // Subscribed and unsubscribing 800 if ( true == $subscribed && false== $subscheck ) {800 if ( true === $subscribed && false === $subscheck ) { 801 801 bbp_remove_user_subscription( $author_id, $topic_id ); 802 802 803 803 // Subscribing 804 } elseif ( false == $subscribed && true== $subscheck ) {804 } elseif ( false === $subscribed && true === $subscheck ) { 805 805 bbp_add_user_subscription( $author_id, $topic_id ); 806 806 } … … 886 886 887 887 // If we want a full refresh, unset any of the possibly passed variables 888 if ( true == $refresh )888 if ( true === $refresh ) 889 889 $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0; 890 890 … … 983 983 984 984 // 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() ) { 986 986 $forum_id = $ancestor; 987 987 … … 1032 1032 1033 1033 // 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() ) { 1035 1035 $topic_id = $ancestor; 1036 1036 … … 1292 1292 1293 1293 // 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 ) ) { 1295 1295 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' ) ); 1296 1296 } … … 1352 1352 // It is a new topic and we need to set some default metas to make 1353 1353 // the topic display in bbp_has_topics() list 1354 if ( 'topic' == $move_option ) {1354 if ( 'topic' === $move_option ) { 1355 1355 bbp_update_topic_last_reply_id ( $destination_topic->ID, $last_reply_id ); 1356 1356 bbp_update_topic_last_active_id ( $destination_topic->ID, $last_reply_id ); … … 1479 1479 1480 1480 // 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 ) ) ) { 1482 1482 bbp_add_error( 'bbp_toggle_reply_permission', __( '<strong>ERROR:</strong> You do not have the permission to do that!', 'bbpress' ) ); 1483 1483 return; … … 1540 1540 1541 1541 // No errors 1542 if ( ( false != $success ) && !is_wp_error( $success ) ) {1542 if ( ( false !== $success ) && !is_wp_error( $success ) ) { 1543 1543 1544 1544 /** Redirect **********************************************************/ … … 1589 1589 1590 1590 // Bail if already spam 1591 if ( bbp_get_spam_status_id() == $reply['post_status'] )1591 if ( bbp_get_spam_status_id() === $reply['post_status'] ) 1592 1592 return false; 1593 1593 … … 1636 1636 1637 1637 // 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'] ) 1639 1639 return false; 1640 1640 … … 1858 1858 1859 1859 // 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' ) ) { 1861 1861 return $where; 1862 1862 } … … 2116 2116 2117 2117 // If reply is actually the first post in a topic, return 0 2118 if ( $reply_id != $topic_id ) {2118 if ( $reply_id !== $topic_id ) { 2119 2119 2120 2120 // Make sure the topic has replies before running another query -
trunk/includes/replies/template-tags.php
r4985 r4995 151 151 152 152 // 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 ) ) { 154 154 $reply_to = 0; 155 155 } … … 342 342 return null; 343 343 344 if ( $output == OBJECT ) {344 if ( $output === OBJECT ) { 345 345 return $reply; 346 346 347 } elseif ( $output == ARRAY_A ) {347 } elseif ( $output === ARRAY_A ) { 348 348 $_reply = get_object_vars( $reply ); 349 349 return $_reply; 350 350 351 } elseif ( $output == ARRAY_N ) {351 } elseif ( $output === ARRAY_N ) { 352 352 $_reply = array_values( get_object_vars( $reply ) ); 353 353 return $_reply; … … 827 827 */ 828 828 function 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(); 830 830 return (bool) apply_filters( 'bbp_is_reply_published', (bool) $reply_status, $reply_id ); 831 831 } … … 842 842 */ 843 843 function 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(); 845 845 return (bool) apply_filters( 'bbp_is_reply_spam', (bool) $reply_status, $reply_id ); 846 846 } … … 857 857 */ 858 858 function 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(); 860 860 return (bool) apply_filters( 'bbp_is_reply_trash', (bool) $reply_status, $reply_id ); 861 861 } … … 1132 1132 1133 1133 // Get avatar 1134 if ( 'avatar' == $r['type'] || 'both'== $r['type'] ) {1134 if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) { 1135 1135 $author_links['avatar'] = bbp_get_reply_author_avatar( $reply_id, $r['size'] ); 1136 1136 } 1137 1137 1138 1138 // Get display name 1139 if ( 'name' == $r['type'] || 'both'== $r['type'] ) {1139 if ( 'name' === $r['type'] || 'both' === $r['type'] ) { 1140 1140 $author_links['name'] = bbp_get_reply_author_display_name( $reply_id ); 1141 1141 } … … 1450 1450 $ancestor_id = $reply_id; 1451 1451 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 ) ) { 1453 1453 break; 1454 1454 } … … 1656 1656 1657 1657 // Post is not the topic 1658 if ( $reply_id != $topic_id ) {1658 if ( $reply_id !== $topic_id ) { 1659 1659 $reply_position = bbp_get_reply_position_raw( $reply_id, $topic_id ); 1660 1660 … … 2199 2199 $classes[] = 'bbp-reply-position-' . bbp_get_reply_position( $reply_id ); 2200 2200 $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' : '' ); 2202 2202 $classes = array_filter( $classes ); 2203 2203 $classes = get_post_class( $classes, $reply_id ); -
trunk/includes/topics/capabilities.php
r4835 r4995 85 85 86 86 // Post is public 87 if ( bbp_get_public_status_id() == $_post->post_status ) {87 if ( bbp_get_public_status_id() === $_post->post_status ) { 88 88 $caps = array( 'spectate' ); 89 89 90 90 // User is author so allow read 91 } elseif ( (int) $user_id == (int) $_post->post_author ) {91 } elseif ( (int) $user_id === (int) $_post->post_author ) { 92 92 $caps = array( 'spectate' ); 93 93 … … 145 145 146 146 // User is author so allow edit 147 } elseif ( (int) $user_id == (int) $_post->post_author ) {147 } elseif ( (int) $user_id === (int) $_post->post_author ) { 148 148 $caps[] = $post_type->cap->edit_posts; 149 149 -
trunk/includes/topics/functions.php
r4990 r4995 157 157 158 158 // 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'] ) { 160 160 remove_filter( 'bbp_new_topic_pre_title', 'wp_filter_kses' ); 161 161 remove_filter( 'bbp_new_topic_pre_content', 'bbp_encode_bad', 10 ); … … 304 304 // If the forum is trash, or the topic_status is switched to 305 305 // 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() ) ) { 307 307 308 308 // Trash the reply … … 316 316 317 317 // 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() ) { 319 319 add_post_meta( $topic_id, '_bbp_spam_meta_status', bbp_get_public_status_id() ); 320 320 … … 488 488 489 489 // 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'] ) ) { 491 491 remove_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' ); 492 492 remove_filter( 'bbp_edit_topic_pre_content', 'bbp_encode_bad', 10 ); … … 659 659 660 660 // 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'] ) ) { 662 662 $revision_id = wp_save_post_revision( $topic_id ); 663 663 if ( ! empty( $revision_id ) ) { … … 676 676 // bbp_move_topic action and pass the topic's forum id as the 677 677 // 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 ) { 679 679 bbp_move_topic_handler( $topic_id, $topic->post_parent, $forum_id ); 680 680 } … … 822 822 if ( bbp_is_subscriptions_active() && !empty( $author_id ) ) { 823 823 $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; 825 825 826 826 // Subscribed and unsubscribing 827 if ( true == $subscribed && false== $subscheck ) {827 if ( true === $subscribed && false === $subscheck ) { 828 828 bbp_remove_user_subscription( $author_id, $topic_id ); 829 829 830 830 // Subscribing 831 } elseif ( false == $subscribed && true== $subscheck ) {831 } elseif ( false === $subscribed && true === $subscheck ) { 832 832 bbp_add_user_subscription( $author_id, $topic_id ); 833 833 } … … 905 905 906 906 // If we want a full refresh, unset any of the possibly passed variables 907 if ( true == $refresh ) {907 if ( true === $refresh ) { 908 908 $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0; 909 909 $topic_status = bbp_get_public_status_id(); … … 975 975 // Loop through stickies of forum and add misses to the updated array 976 976 foreach ( (array) $old_stickies as $sticky_topic_id ) { 977 if ( $topic_id != $sticky_topic_id ) {977 if ( $topic_id !== $sticky_topic_id ) { 978 978 $updated_stickies[] = $sticky_topic_id; 979 979 } … … 981 981 982 982 // If stickies are different, update or delete them 983 if ( $updated_stickies != $old_stickies ) {983 if ( $updated_stickies !== $old_stickies ) { 984 984 985 985 // No more stickies so delete the meta … … 1176 1176 1177 1177 // 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() ) 1179 1179 bbp_add_user_subscription( $subscriber, $destination_topic->ID ); 1180 1180 … … 1196 1196 1197 1197 // 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'] ) 1199 1199 bbp_add_user_favorite( $favoriter, $destination_topic->ID ); 1200 1200 … … 1213 1213 1214 1214 // 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'] ) ) 1216 1216 wp_set_post_terms( $destination_topic->ID, $source_topic_tags, bbp_get_topic_tag_tax_id(), true ); 1217 1217 … … 1486 1486 1487 1487 // 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 ) ) { 1489 1489 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' ) ); 1490 1490 } … … 1527 1527 1528 1528 // 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() ) { 1530 1530 1531 1531 // Get the subscribers … … 1544 1544 1545 1545 // 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'] ) { 1547 1547 1548 1548 // Get the favoriters … … 1561 1561 1562 1562 // 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'] ) ) { 1564 1564 1565 1565 // Get the source topic tags … … 1629 1629 1630 1630 // 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 ) ) { 1632 1632 bbp_update_reply_to( $reply->ID, 0 ); 1633 1633 } … … 1638 1638 1639 1639 // Remove reply to from new topic 1640 if ( $from_reply->ID == $destination_topic->ID ) {1640 if ( $from_reply->ID === $destination_topic->ID ) { 1641 1641 delete_post_meta( $from_reply->ID, '_bbp_reply_to' ); 1642 1642 } … … 1654 1654 // It is a new topic and we need to set some default metas to make 1655 1655 // the topic display in bbp_has_topics() list 1656 if ( 'reply' == $split_option ) {1656 if ( 'reply' === $split_option ) { 1657 1657 bbp_update_topic_last_reply_id ( $destination_topic->ID, $last_reply_id ); 1658 1658 bbp_update_topic_last_active_id ( $destination_topic->ID, $last_reply_id ); … … 1843 1843 1844 1844 // Attempting to merge a tag into itself 1845 if ( $tag_id == $to_tag ) {1845 if ( $tag_id === $to_tag ) { 1846 1846 bbp_add_error( 'bbp_manage_topic_tag_merge_same', __( '<strong>ERROR</strong>: The tags which are being merged can not be the same.', 'bbpress' ) ); 1847 1847 return; … … 2009 2009 2010 2010 // 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 ) ) ) { 2012 2012 bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>ERROR:</strong> You do not have the permission to do that.', 'bbpress' ) ); 2013 2013 return; … … 2032 2032 2033 2033 $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; 2035 2035 $success = $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super ); 2036 2036 $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' ); … … 2091 2091 2092 2092 // No errors 2093 if ( false != $success && !is_wp_error( $success ) ) {2093 if ( false !== $success && !is_wp_error( $success ) ) { 2094 2094 2095 2095 // Redirect back to the topic's forum 2096 if ( isset( $sub_action ) && ( 'delete' == $sub_action ) ) {2096 if ( isset( $sub_action ) && ( 'delete' === $sub_action ) ) { 2097 2097 $redirect = bbp_get_forum_permalink( $success->post_parent ); 2098 2098 … … 2409 2409 2410 2410 // 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 ) ) { 2412 2412 update_post_meta( $topic_id, '_bbp_last_active_id', (int) $active_id ); 2413 2413 } … … 2640 2640 2641 2641 // Bail if already closed 2642 if ( bbp_get_closed_status_id() == $topic['post_status'] )2642 if ( bbp_get_closed_status_id() === $topic['post_status'] ) 2643 2643 return false; 2644 2644 … … 2686 2686 2687 2687 // Bail if already open 2688 if ( bbp_get_closed_status_id() != $topic['post_status'])2688 if ( bbp_get_closed_status_id() !== $topic['post_status']) 2689 2689 return false; 2690 2690 … … 2734 2734 2735 2735 // 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'] ) 2737 2737 return false; 2738 2738 … … 2843 2843 2844 2844 // 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'] ) 2846 2846 return false; 2847 2847 -
trunk/includes/topics/template-tags.php
r4987 r4995 148 148 149 149 // Set post_parent back to 0 if originally set to 'any' 150 if ( 'any' == $r['post_parent'] )150 if ( 'any' === $r['post_parent'] ) 151 151 $r['post_parent'] = 0; 152 152 … … 270 270 271 271 // 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'] ) 273 273 $r['posts_per_page'] = $bbp->topic_query->post_count; 274 274 … … 340 340 'base' => $base, 341 341 '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'] ), 343 343 'current' => (int) $bbp->topic_query->paged, 344 344 'prev_text' => is_rtl() ? '→' : '←', … … 486 486 487 487 // Tweak the data type to return 488 if ( $output == OBJECT ) {488 if ( $output === OBJECT ) { 489 489 return $topic; 490 490 491 } elseif ( $output == ARRAY_A ) {491 } elseif ( $output === ARRAY_A ) { 492 492 $_topic = get_object_vars( $topic ); 493 493 return $_topic; 494 494 495 } elseif ( $output == ARRAY_N ) {495 } elseif ( $output === ARRAY_N ) { 496 496 $_topic = array_values( get_object_vars( $topic ) ); 497 497 return $_topic; … … 1059 1059 */ 1060 1060 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(); 1062 1062 return (bool) apply_filters( 'bbp_is_topic_closed', (bool) $closed, $topic_id ); 1063 1063 } … … 1118 1118 */ 1119 1119 function 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(); 1121 1121 return (bool) apply_filters( 'bbp_is_topic_published', (bool) $topic_status, $topic_id ); 1122 1122 } … … 1134 1134 */ 1135 1135 function 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(); 1137 1137 return (bool) apply_filters( 'bbp_is_topic_spam', (bool) $topic_status, $topic_id ); 1138 1138 } … … 1150 1150 */ 1151 1151 function 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(); 1153 1153 return (bool) apply_filters( 'bbp_is_topic_trash', (bool) $topic_status, $topic_id ); 1154 1154 } … … 1429 1429 1430 1430 // Get avatar 1431 if ( 'avatar' == $r['type'] || 'both'== $r['type'] ) {1431 if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) { 1432 1432 $author_links['avatar'] = bbp_get_topic_author_avatar( $topic_id, $r['size'] ); 1433 1433 } 1434 1434 1435 1435 // Get display name 1436 if ( 'name' == $r['type'] || 'both'== $r['type'] ) {1436 if ( 'name' === $r['type'] || 'both' === $r['type'] ) { 1437 1437 $author_links['name'] = bbp_get_topic_author_display_name( $topic_id ); 1438 1438 } … … 1864 1864 $reply_id = bbp_get_topic_last_reply_id( $topic_id ); 1865 1865 1866 if ( !empty( $reply_id ) && ( $reply_id != $topic_id ) ) {1866 if ( !empty( $reply_id ) && ( $reply_id !== $topic_id ) ) { 1867 1867 $reply_url = bbp_get_reply_url( $reply_id ); 1868 1868 } else { … … 2607 2607 $stick_uri = esc_url( wp_nonce_url( $stick_uri, 'stick-topic_' . $topic->ID ) ); 2608 2608 2609 $stick_display = true == $is_sticky ? $r['unstick_text'] : $r['stick_text'];2609 $stick_display = true === $is_sticky ? $r['unstick_text'] : $r['stick_text']; 2610 2610 $stick_display = '<a href="' . $stick_uri . '">' . $stick_display . '</a>'; 2611 2611 … … 3628 3628 3629 3629 // 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 ) { 3631 3631 $topic_subscribed = bbp_is_user_subscribed( $post_author ); 3632 3632 -
trunk/includes/users/capabilities.php
r4956 r4995 69 69 70 70 // User already has this role so no new role is set 71 if ( $new_role == $role ) {71 if ( $new_role === $role ) { 72 72 $new_role = false; 73 73 … … 193 193 194 194 // Bail if no role change 195 if ( $new_role == $forums_role )195 if ( $new_role === $forums_role ) 196 196 return; 197 197 … … 281 281 282 282 // Add the user to the site 283 if ( true == $add_to_site ) {283 if ( true === $add_to_site ) { 284 284 285 285 // Make sure bbPress roles are added -
trunk/includes/users/functions.php
r4981 r4995 32 32 33 33 // $url was manually set in wp-login.php to redirect to admin 34 elseif ( admin_url() == $url )34 elseif ( admin_url() === $url ) 35 35 $url = home_url(); 36 36 … … 473 473 $success = false; 474 474 475 if ( true == $is_favorite && 'bbp_favorite_remove'== $action )475 if ( true === $is_favorite && 'bbp_favorite_remove' === $action ) 476 476 $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 ) 478 478 $success = bbp_add_user_favorite( $user_id, $topic_id ); 479 479 … … 482 482 483 483 // Success! 484 if ( true == $success ) {484 if ( true === $success ) { 485 485 486 486 // Redirect back from whence we came … … 503 503 504 504 // Fail! Handle errors 505 } elseif ( true == $is_favorite && 'bbp_favorite_remove'== $action ) {505 } elseif ( true === $is_favorite && 'bbp_favorite_remove' === $action ) { 506 506 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 ) { 508 508 bbp_add_error( 'bbp_favorite_add', __( '<strong>ERROR</strong>: There was a problem favoriting that topic!', 'bbpress' ) ); 509 509 } … … 786 786 $success = false; 787 787 788 if ( true == $is_subscription && 'bbp_unsubscribe'== $action )788 if ( true === $is_subscription && 'bbp_unsubscribe' === $action ) 789 789 $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 ) 791 791 $success = bbp_add_user_subscription( $user_id, $topic_id ); 792 792 … … 795 795 796 796 // Success! 797 if ( true == $success ) {797 if ( true === $success ) { 798 798 799 799 // Redirect back from whence we came … … 816 816 817 817 // Fail! Handle errors 818 } elseif ( true == $is_subscription && 'bbp_unsubscribe'== $action ) {818 } elseif ( true === $is_subscription && 'bbp_unsubscribe' === $action ) { 819 819 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 ) { 821 821 bbp_add_error( 'bbp_subscribe', __( '<strong>ERROR</strong>: There was a problem subscribing to that topic!', 'bbpress' ) ); 822 822 } … … 868 868 $new_email = get_option( $user_id . '_new_email' ); 869 869 870 if ( $new_email['hash'] == $_GET['newuseremail'] ) {870 if ( $new_email['hash'] === $_GET['newuseremail'] ) { 871 871 $user = new stdClass(); 872 872 $user->ID = $user_id; … … 887 887 888 888 // 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'] ) ) { 890 890 delete_option( $user_id . '_new_email' ); 891 891 wp_safe_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) ); -
trunk/includes/users/options.php
r4957 r4995 153 153 154 154 $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'; 156 156 157 157 return apply_filters( $filter, $count, $user_id ); … … 191 191 192 192 $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'; 194 194 195 195 return apply_filters( $filter, $count, $user_id ); … … 231 231 $replies = bbp_get_user_reply_count( $user_id, true ); 232 232 $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'; 234 234 235 235 return apply_filters( $filter, $count, $user_id ); -
trunk/includes/users/template-tags.php
r4984 r4995 1237 1237 1238 1238 // loggedout was passed 1239 if ( !empty( $_GET['loggedout'] ) && ( true == $_GET['loggedout'] ) ) {1239 if ( !empty( $_GET['loggedout'] ) && ( true === $_GET['loggedout'] ) ) { 1240 1240 bbp_add_error( 'loggedout', __( 'You are now logged out.', 'bbpress' ), 'message' ); 1241 1241 1242 1242 // registration is disabled 1243 } elseif ( !empty( $_GET['registration'] ) && ( 'disabled' == $_GET['registration'] ) ) {1243 } elseif ( !empty( $_GET['registration'] ) && ( 'disabled' === $_GET['registration'] ) ) { 1244 1244 bbp_add_error( 'registerdisabled', __( 'New user registration is currently not allowed.', 'bbpress' ) ); 1245 1245 … … 1445 1445 1446 1446 // Get avatar 1447 if ( 'avatar' == $r['type'] || 'both'== $r['type'] ) {1447 if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) { 1448 1448 $author_links[] = get_avatar( $user_id, $r['size'] ); 1449 1449 } 1450 1450 1451 1451 // Get display name 1452 if ( 'name' == $r['type'] || 'both'== $r['type'] ) {1452 if ( 'name' === $r['type'] || 'both' === $r['type'] ) { 1453 1453 $author_links[] = get_the_author_meta( 'display_name', $user_id ); 1454 1454 } -
trunk/templates/default/bbpress/form-user-edit.php
r4980 r4995 109 109 // Handle address change requests 110 110 $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' ) ) : ?> 112 112 113 113 <span class="updated inline"> -
trunk/templates/default/bbpress/loop-single-topic.php
r4948 r4995 62 62 <?php do_action( 'bbp_theme_after_topic_started_by' ); ?> 63 63 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() ) ) : ?> 65 65 66 66 <?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
Note: See TracChangeset
for help on using the changeset viewer.