Changeset 7006
- Timestamp:
- 11/24/2019 01:38:37 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 51 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.gitignore
r6498 r7006 9 9 /node_modules 10 10 /npm-debug.log 11 .phpcscache 11 12 12 13 # Output directory. -
trunk/Gruntfile.js
r6912 r7006 222 222 } 223 223 }, 224 phpcs: { 225 'default': { 226 cmd: 'phpcs', 227 args: [ '--standard=phpcs.xml.dist', '--report-summary', '--report-source', '--cache=.phpcscache' ] 228 } 229 }, 224 230 phpunit: { 225 231 'default': { … … 390 396 grunt.registerTask( 'release', [ 'build' ] ); 391 397 398 // PHPCS test task. 399 grunt.registerMultiTask( 'phpcs', 'Runs PHPCS tests.', function() { 400 grunt.util.spawn( { 401 cmd: this.data.cmd, 402 args: this.data.args, 403 opts: { stdio: 'inherit' } 404 }, this.async() ); 405 } ); 406 392 407 // PHPUnit test task. 393 408 grunt.registerMultiTask( 'phpunit', 'Runs PHPUnit tests, including the BuddyPress and multisite tests.', function() { -
trunk/src/bbpress.php
r6967 r7006 170 170 * @since 2.1.0 bbPress (r3951) 171 171 */ 172 public function __set( $key 172 public function __set( $key, $value ) { $this->data[ $key ] = $value; } 173 173 174 174 /** … … 551 551 'menu_icon' => '', 552 552 'source' => 'bbpress', 553 ) 554 ) );553 ) ) 554 ); 555 555 556 556 /** Replies ***********************************************************/ -
trunk/src/includes/admin/classes/class-bbp-admin.php
r6937 r7006 236 236 $bbp_dashicon = '<span class="bbpress-logo-icon"></span>'; 237 237 $message = $bbp_dashicon . sprintf( 238 esc_html__( 'bbPress requires a manual database upgrade. % s or %s.', 'bbpress' ),238 esc_html__( 'bbPress requires a manual database upgrade. %1$s or %1$s.', 'bbpress' ), 239 239 $upgrade_link, 240 240 $dismiss_link … … 325 325 // Messages as objects 326 326 } elseif ( is_wp_error( $message ) ) { 327 $errors 327 $errors = $message->get_error_messages(); 328 328 329 329 switch ( count( $errors ) ) { … … 914 914 if ( ! empty( $topics ) ) { 915 915 foreach ( (array) $topics as $post ) { 916 printf( esc_html__( '% s - %s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) . "\n" );916 printf( esc_html__( '%1$s - %2$s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) . "\n" ); 917 917 } 918 918 } … … 951 951 if ( ! empty( $users_query->results ) ) { 952 952 foreach ( (array) $users_query->results as $user ) { 953 printf( esc_html__( '% s - %s', 'bbpress' ), bbp_get_user_id( $user->ID ), bbp_get_user_nicename( $user->ID, array( 'force' => $user->user_nicename ) ) . "\n" );953 printf( esc_html__( '%1$s - %2$s', 'bbpress' ), bbp_get_user_id( $user->ID ), bbp_get_user_nicename( $user->ID, array( 'force' => $user->user_nicename ) ) . "\n" ); 954 954 } 955 955 } … … 1336 1336 <!-- 1337 1337 function nextpage() { 1338 location.href = 'update-core.php?page=bbpress-update&action=bbpress-update&n=<?php echo ( $n + 5 ) ?>';1338 location.href = 'update-core.php?page=bbpress-update&action=bbpress-update&n=<?php echo ( $n + 5 ); ?>'; 1339 1339 } 1340 1340 setTimeout( 'nextpage()', 250 ); -
trunk/src/includes/admin/classes/class-bbp-converter-base.php
r6832 r7006 392 392 393 393 // No 'WHERE' in expression 394 if ( stripos( $from_tablename, "WHERE") === false ) {394 if ( stripos( $from_tablename, 'WHERE' ) === false ) { 395 395 $from_tablename .= ' ' . $item['from_expression']; 396 396 397 397 // 'WHERE' in expression, so replace with 'AND' 398 398 } else { 399 $from_tablename .= ' ' . str_replace( "WHERE", "AND", $item['from_expression'] );399 $from_tablename .= ' ' . str_replace( 'WHERE', 'AND', $item['from_expression'] ); 400 400 } 401 401 } … … 533 533 case 'tags' : 534 534 $post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true ); 535 $term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag');535 $term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag'); 536 536 if ( false !== $term ) { 537 537 wp_update_term( $term->term_id, 'topic-tag', array( -
trunk/src/includes/admin/classes/class-bbp-topic-replies-list-table.php
r6770 r7006 331 331 // Hierarchy 332 332 if ( ! empty( $item->post_parent ) ) { 333 334 333 $count = count( get_post_ancestors( $item->ID ) ); 334 $classes .= ' level-'. $count; 335 335 } else { 336 336 $classes .= ' level-0'; 337 337 } ?> 338 338 -
trunk/src/includes/admin/converters/Invision.php
r6670 r7006 541 541 542 542 private function to_char( $input ) { 543 $output = "";543 $output = ''; 544 544 for ( $i = 0; $i < strlen( $input ); $i++ ) { 545 545 $j = ord( $input{$i} ); 546 546 if ( ( $j >= 65 && $j <= 90 ) 547 547 || ( $j >= 97 && $j <= 122 ) 548 || ( $j >= 48 && $j <= 57 ) ) 549 { 548 || ( $j >= 48 && $j <= 57 ) ) { 550 549 $output .= $input{$i}; 551 550 } else { 552 $output .= "&#" . ord( $input{$i} ) . ";";551 $output .= '&#' . ord( $input{$i} ) . ''; 553 552 } 554 553 } -
trunk/src/includes/admin/converters/Kunena2.php
r6670 r7006 299 299 */ 300 300 301 301 /** Reply Section *****************************************************/ 302 302 303 303 // Old reply id (Stored in postmeta) -
trunk/src/includes/admin/converters/Mingle.php
r6670 r7006 28 28 * Sets up the field mappings 29 29 */ 30 public function setup_globals() 30 public function setup_globals() { 31 31 32 32 // Setup smiley URL & path -
trunk/src/includes/admin/converters/SMF.php
r6670 r7006 741 741 742 742 // Replace '[quote]' with '<blockquote>' 743 $SMF_markup = preg_replace( '/\[quote\]/', 743 $SMF_markup = preg_replace( '/\[quote\]/', '<blockquote>', $SMF_markup ); 744 744 // Replace '[quote ($1)]' with '<blockquote>" 745 $SMF_markup = preg_replace( '/\[quote (.*?)\]/' 745 $SMF_markup = preg_replace( '/\[quote (.*?)\]/', '<blockquote>', $SMF_markup ); 746 746 // Replace '[/quote]' with '</blockquote>' 747 $SMF_markup = preg_replace( '/\[\/quote\]/', 747 $SMF_markup = preg_replace( '/\[\/quote\]/', '</blockquote>', $SMF_markup ); 748 748 749 749 // Replace '[glow]' with '' -
trunk/src/includes/admin/converters/SimplePress5.php
r6670 r7006 587 587 588 588 // Replace any SimplePress smilies from path '/sp-resources/forum-smileys/sf-smily.gif' with the equivelant WordPress Smilie 589 $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-confused\.gif(.*?)\" \/>/', ':?' ,$simplepress_markup );589 $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-confused\.gif(.*?)\" \/>/', ':?', $simplepress_markup ); 590 590 $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-cool\.gif(.*?)\" \/>/', ':cool:', $simplepress_markup ); 591 591 $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-cry\.gif(.*?)\" \/>/', ':cry:', $simplepress_markup ); 592 $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-embarassed\.gif(.*?)\" \/>/' ,':oops:', $simplepress_markup );592 $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-embarassed\.gif(.*?)\" \/>/', ':oops:', $simplepress_markup ); 593 593 $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-frown\.gif(.*?)\" \/>/', ':(', $simplepress_markup ); 594 594 $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-kiss\.gif(.*?)\" \/>/', ':P', $simplepress_markup ); … … 600 600 601 601 // Replace '<div class="sfcode">example code</div>' with '<code>*</code>' 602 $simplepress_markup = preg_replace( '/\<div class\=\"sfcode\"\>(.*?)\<\/div\>/' , '<code>$1</code>', $simplepress_markup );602 $simplepress_markup = preg_replace( '/\<div class\=\"sfcode\"\>(.*?)\<\/div\>/', '<code>$1</code>', $simplepress_markup ); 603 603 604 604 // Replace '<strong>username said </strong>' with '@username said:' -
trunk/src/includes/admin/converters/XenForo.php
r6749 r7006 698 698 public function authenticate_pass( $password, $serialized_pass ) { 699 699 $pass_array = unserialize( $serialized_pass ); 700 switch ( $pass_array['hashFunc'] ) {700 switch ( $pass_array['hashFunc'] ) { 701 701 case 'sha256': 702 702 return ( $pass_array['hash'] == hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) ); -
trunk/src/includes/admin/converters/e107v1.php
r6670 r7006 613 613 $e107v1_markup = preg_replace( '/\[quote(.*?)=(.*?)\]/', '<em>@$2 wrote:</em><blockquote>', $e107v1_markup ); 614 614 // Replace '[/quote$1]' with '</blockquote>" 615 $e107v1_markup = preg_replace( '/\[\/quote(.*?)\]/' ,'</blockquote>', $e107v1_markup );615 $e107v1_markup = preg_replace( '/\[\/quote(.*?)\]/', '</blockquote>', $e107v1_markup ); 616 616 617 617 // Remove '[justify]' -
trunk/src/includes/admin/converters/phpBB.php
r6809 r7006 830 830 } 831 831 832 $output .= $itoa64[( $value >> 18) & 0x3f];832 $output .= $itoa64[( $value >> 18 ) & 0x3f]; 833 833 } while ( $i < $count ); 834 834 -
trunk/src/includes/admin/converters/vBulletin3.php
r6766 r7006 641 641 */ 642 642 public function callback_savepass( $field, $row ) { 643 $pass_array = array( 'hash' => $field, 'salt'=> $row['salt'] );643 $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] ); 644 644 return $pass_array; 645 645 } … … 737 737 $vbulletin_markup = preg_replace( '/\[QUOTE\]/', '<blockquote>', $vbulletin_markup ); 738 738 // Replace '[QUOTE=User Name($1);PostID($2)]' with '<em>@$1 $2 wrote:</em><blockquote>" 739 $vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/' 739 $vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/', '<em>@$1 $2 wrote:</em><blockquote>', $vbulletin_markup ); 740 740 // Replace '[/QUOTE]' with '</blockquote>' 741 741 $vbulletin_markup = preg_replace( '/\[\/QUOTE\]/', '</blockquote>', $vbulletin_markup ); -
trunk/src/includes/admin/forums.php
r6989 r7006 540 540 'bbp_forum_mods' => esc_html__( 'Moderators', 'bbpress' ), 541 541 'author' => esc_html__( 'Creator', 'bbpress' ), 542 'bbp_forum_created' => esc_html__( 'Created' ,'bbpress' ),542 'bbp_forum_created' => esc_html__( 'Created', 'bbpress' ), 543 543 'bbp_forum_freshness' => esc_html__( 'Last Post', 'bbpress' ) 544 544 ); … … 694 694 // Messages array 695 695 $messages[ $this->post_type ] = array( 696 0 => 696 0 => '', // Left empty on purpose 697 697 698 698 // Updated 699 1 => 699 1 => sprintf( 700 700 '%1$s <a href="%2$s">%3$s</a>', 701 701 esc_html__( 'Forum updated.', 'bbpress' ), -
trunk/src/includes/admin/metaboxes.php
r6924 r7006 316 316 <p> 317 317 <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong> 318 <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ) ?></label>318 <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ); ?></label> 319 319 <?php bbp_form_forum_type_dropdown( array( 'forum_id' => $post->ID ) ); ?> 320 320 </p> … … 328 328 <p> 329 329 <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong> 330 <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ) ?></label>330 <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ); ?></label> 331 331 <?php bbp_form_forum_status_dropdown( array( 'forum_id' => $post->ID ) ); ?> 332 332 </p> … … 340 340 <p> 341 341 <strong class="label"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></strong> 342 <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ) ?></label>342 <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></label> 343 343 <?php bbp_form_forum_visibility_dropdown( array( 'forum_id' => $post->ID ) ); ?> 344 344 </p> -
trunk/src/includes/admin/replies.php
r6850 r7006 270 270 271 271 $sendback = remove_query_arg( array( 'spam', 'unspam' ), $sendback ); 272 $updated = $locked = 0;272 $updated = $locked = 0; 273 273 274 274 if ( 'spam' === $doaction ) { … … 814 814 // Show the 'spam' link on published and pending replies and 'not spam' on spammed replies 815 815 if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_trash_status_id(), bbp_get_pending_status_id(), bbp_get_spam_status_id() ), true ) ) { 816 $spam_uri 816 $spam_uri = wp_nonce_url( add_query_arg( array( 'reply_id' => $reply->ID, 'action' => 'bbp_toggle_reply_spam' ), remove_query_arg( array( 'bbp_reply_toggle_notice', 'reply_id', 'failed', 'super' ) ) ), 'spam-reply_' . $reply->ID ); 817 817 if ( ! bbp_is_reply_spam( $reply->ID ) ) { 818 $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this reply as spam', 'bbpress' ) . '">' . esc_html__( 'Spam', 'bbpress' ) . '</a>';818 $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this reply as spam', 'bbpress' ) . '">' . esc_html__( 'Spam', 'bbpress' ) . '</a>'; 819 819 } else { 820 820 $actions['unspam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . esc_html__( 'Not Spam', 'bbpress' ) . '</a>'; … … 829 829 if ( bbp_get_trash_status_id() === $reply->post_status ) { 830 830 $post_type_object = get_post_type_object( bbp_get_reply_post_type() ); 831 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $reply->ID ) ), 'untrash-post_' . $reply->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";831 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $reply->ID ) ), 'untrash-post_' . $reply->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . '</a>'; 832 832 } elseif ( ! empty( $trash_days ) ) { 833 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";833 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . '</a>'; 834 834 } 835 835 836 836 if ( ( bbp_get_trash_status_id() === $reply->post_status ) || empty( $trash_days ) ) { 837 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";837 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . '</a>'; 838 838 } 839 839 } … … 964 964 // Messages array 965 965 $messages[ $this->post_type ] = array( 966 0 => 966 0 => '', // Left empty on purpose 967 967 968 968 // Updated 969 1 => 969 1 => sprintf( 970 970 '%1$s <a href="%2$s">%3$s</a>', 971 971 esc_html__( 'Reply updated.', 'bbpress' ), -
trunk/src/includes/admin/settings.php
r6967 r7006 969 969 if ( ! empty( $theme_options ) ) : ?> 970 970 971 <select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options ?></select>971 <select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options; ?></select> 972 972 <label for="_bbp_theme_package_id"><?php esc_html_e( 'will serve all bbPress templates', 'bbpress' ); ?></label> 973 973 … … 1465 1465 // Button & text 1466 1466 $button = '<a href="' . esc_url( $new_url ) . '">' . esc_html__( 'create a new one', 'bbpress' ) . '</a>'; 1467 $text = esc_html__( 'Use %s to contain your group forums, or %s', 'bbpress' ); 1467 $text = esc_html__( 'Use %s to contain your group forums, or %s', 'bbpress' ); //phpcs:ignore 1468 1468 } else { 1469 1469 $text = esc_html__( 'Use %s to contain your group forums', 'bbpress' ); … … 1518 1518 1519 1519 <div class="wrap"> 1520 <h1 class="wp-heading-inline"><?php esc_html_e( 'Forums Settings', 'bbpress' ) ?></h1>1520 <h1 class="wp-heading-inline"><?php esc_html_e( 'Forums Settings', 'bbpress' ); ?></h1> 1521 1521 <hr class="wp-header-end"> 1522 1522 … … 1568 1568 } ?> 1569 1569 1570 <select name="_bbp_converter_platform" id="_bbp_converter_platform"><?php echo $options ?></select>1570 <select name="_bbp_converter_platform" id="_bbp_converter_platform"><?php echo $options; ?></select> 1571 1571 <p class="description"><?php esc_html_e( 'The previous forum software', 'bbpress' ); ?></p> 1572 1572 … … 1793 1793 // Starting or continuing? 1794 1794 $progress_text = ! empty( $step ) 1795 ? sprintf( esc_html__( 'Previously stopped at step % d of %d', 'bbpress' ), $step, $max )1795 ? sprintf( esc_html__( 'Previously stopped at step %1$d of %2$d', 'bbpress' ), $step, $max ) 1796 1796 : esc_html__( 'Ready to go.', 'bbpress' ); ?> 1797 1797 … … 1958 1958 * @param bool $slug 1959 1959 */ 1960 function bbp_form_option( $option, $default = '' 1960 function bbp_form_option( $option, $default = '', $slug = false ) { 1961 1961 echo bbp_get_form_option( $option, $default, $slug ); 1962 1962 } -
trunk/src/includes/admin/tools.php
r6976 r7006 28 28 29 29 <div class="card"> 30 <h3 class="title"><?php esc_html_e( 'Forums', 'bbpress' ) ?></h3>30 <h3 class="title"><?php esc_html_e( 'Forums', 'bbpress' ); ?></h3> 31 31 <p><?php esc_html_e( 'bbPress provides the following tools to help you manage your forums:', 'bbpress' ); ?></p> 32 32 -
trunk/src/includes/admin/tools/common.php
r6934 r7006 220 220 221 221 // Get tools 222 $tools 222 $tools = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() ); 223 223 224 224 // Loop through tools … … 312 312 313 313 // Get tools 314 $tools 314 $tools = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() ); 315 315 316 316 // Loop through tools … … 525 525 526 526 // Overhead 527 $overhead 527 $overhead = ! empty( $_GET['overhead'] ) 528 528 ? sanitize_key( $_GET['overhead'] ) 529 529 : ''; -
trunk/src/includes/admin/tools/repair.php
r6934 r7006 426 426 427 427 if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) { 428 428 return array( 1, sprintf( $statement, $result ) ); 429 429 } 430 430 … … 468 468 469 469 if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) { 470 470 return array( 1, sprintf( $statement, $result ) ); 471 471 } 472 472 … … 992 992 } 993 993 994 995 994 // Loop through forums 995 foreach ( $forums as $forum_id ) { 996 996 if ( ! bbp_is_forum_category( $forum_id ) ) { 997 997 bbp_update_forum( array( 'forum_id' => $forum_id ) ); … … 1107 1107 1108 1108 // If we don't have a postmeta _bbp_status value 1109 if ( empty( $topic_status ) ) {1109 if ( empty( $topic_status ) ) { 1110 1110 update_post_meta( $closed_topic, '_bbp_status', 'publish' ); 1111 1111 ++$changed; // Keep a count to display at the end -
trunk/src/includes/admin/tools/reset.php
r6896 r7006 30 30 <tbody> 31 31 <tr valign="top"> 32 <th scope="row"><?php esc_html_e( 'The following data will be removed:', 'bbpress' ) ?></th>32 <th scope="row"><?php esc_html_e( 'The following data will be removed:', 'bbpress' ); ?></th> 33 33 <td> 34 34 <?php esc_html_e( 'All Forums', 'bbpress' ); ?><br /> -
trunk/src/includes/admin/tools/upgrade.php
r6990 r7006 386 386 387 387 // Complete results 388 $result = sprintf( esc_html__( 'Complete! % s groups updated; %s forums updated; %s forum statuses synced.', 'bbpress' ), bbp_number_format( $g_count ), bbp_number_format( $f_count ), bbp_number_format( $s_count ) );388 $result = sprintf( esc_html__( 'Complete! %1$s groups updated; %2$s forums updated; %3$s forum statuses synced.', 'bbpress' ), bbp_number_format( $g_count ), bbp_number_format( $f_count ), bbp_number_format( $s_count ) ); 389 389 return array( 0, sprintf( $statement, $result ) ); 390 390 } -
trunk/src/includes/admin/topics.php
r6850 r7006 275 275 276 276 $sendback = remove_query_arg( array( 'spam', 'unspam' ), $sendback ); 277 $updated = $locked = 0;277 $updated = $locked = 0; 278 278 279 279 if ( 'spam' === $doaction ) { … … 619 619 620 620 $is_sticky = bbp_is_topic_sticky( $topic_id ); 621 $is_super = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( "1"=== $_GET['super'] )621 $is_super = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( '1' === $_GET['super'] ) 622 622 ? true 623 623 : false; … … 693 693 // Bail if no topic_id or notice 694 694 $topic_id = bbp_get_topic_id( $_GET['topic_id'] ); 695 if ( 695 if ( empty( $topic_id ) ) { 696 696 return; 697 697 } … … 1033 1033 if ( bbp_get_trash_status_id() === $topic->post_status ) { 1034 1034 $post_type_object = get_post_type_object( bbp_get_topic_post_type() ); 1035 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $topic->ID ) ), 'untrash-post_' . $topic->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";1035 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $topic->ID ) ), 'untrash-post_' . $topic->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . '</a>'; 1036 1036 } elseif ( ! empty( $trash_days ) ) { 1037 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";1037 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . '</a>'; 1038 1038 } 1039 1039 1040 1040 if ( ( bbp_get_trash_status_id() === $topic->post_status ) || empty( $trash_days ) ) { 1041 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";1041 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . '</a>'; 1042 1042 } 1043 1043 } … … 1168 1168 // Messages array 1169 1169 $messages[ $this->post_type ] = array( 1170 0 => 1170 0 => '', // Left empty on purpose 1171 1171 1172 1172 // Updated 1173 1 => 1173 1 => sprintf( 1174 1174 '%1$s <a href="%2$s">%3$s</a>', 1175 1175 esc_html__( 'Topic updated.', 'bbpress' ), -
trunk/src/includes/admin/users.php
r6817 r7006 162 162 ?> 163 163 164 <label class="screen-reader-text" for="<?php echo $select_id; ?>"><?php esc_html_e( 'Change forum role to…', 'bbpress' ) ?></label>164 <label class="screen-reader-text" for="<?php echo $select_id; ?>"><?php esc_html_e( 'Change forum role to…', 'bbpress' ); ?></label> 165 165 <select name="<?php echo $select_id; ?>" id="<?php echo $select_id; ?>" style="display:inline-block; float:none;"> 166 <option value=''><?php esc_html_e( 'Change forum role to…', 'bbpress' ) ?></option>166 <option value=''><?php esc_html_e( 'Change forum role to…', 'bbpress' ); ?></option> 167 167 <?php foreach ( $dynamic_roles as $role => $details ) : ?> 168 168 <option value="<?php echo esc_attr( $role ); ?>"><?php echo bbp_translate_user_role( $details['name'] ); ?></option> -
trunk/src/includes/common/engagements.php
r7005 r7006 811 811 // Try to delete caches, but only if everything else succeeded 812 812 if ( ! empty( $retval ) && ! empty( $object_ids ) ) { 813 foreach ( $object_ids as $object_id ) {813 foreach ( $object_ids as $object_id ) { 814 814 $this->cache_delete( $meta_key, $object_id ); 815 815 } -
trunk/src/includes/common/formatting.php
r6924 r7006 97 97 */ 98 98 function bbp_kses_data( $data = '' ) { 99 return wp_kses( $data 99 return wp_kses( $data, bbp_kses_allowed_tags() ); 100 100 } 101 101 … … 112 112 function bbp_code_trick( $content = '' ) { 113 113 $content = str_replace( array( "\r\n", "\r" ), "\n", $content ); 114 $content = preg_replace_callback( "|(`)(.*?)`|", 'bbp_encode_callback', $content );114 $content = preg_replace_callback('|(`)(.*?)`|', 'bbp_encode_callback', $content ); 115 115 $content = preg_replace_callback( "!(^|\n)`(.*?)`!s", 'bbp_encode_callback', $content ); 116 116 … … 131 131 // Setup variables 132 132 $openers = array( '<p>', '<br />' ); 133 $content = preg_replace_callback( "!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s", 'bbp_decode_callback', $content );133 $content = preg_replace_callback( '!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s', 'bbp_decode_callback', $content ); 134 134 135 135 // Do the do … … 197 197 198 198 // Trim inline code, not pre blocks (to prevent removing indentation) 199 if ( "`"=== $matches[1] ) {199 if ( '`' === $matches[1] ) { 200 200 $content = trim( $matches[2] ); 201 201 } else { … … 215 215 216 216 // Wrap blocks in pre tags 217 if ( "`"!== $matches[1] ) {217 if ('`' !== $matches[1] ) { 218 218 $content = "\n<pre>" . $content . "</pre>\n"; 219 219 } … … 235 235 // Setup variables 236 236 $trans_table = array_flip( get_html_translation_table( HTML_ENTITIES ) ); 237 $amps = array( '&', '&', '&' );238 $single = array( ''', ''' );237 $amps = array( '&', '&', '&' ); 238 $single = array( ''', ''' ); 239 239 $content = $matches[2]; 240 240 $content = strtr( $content, $trans_table ); … … 314 314 // Bail on links that match the current domain 315 315 if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'http' ) ) . ')%i', $text ) || 316 316 preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'https' ) ) . ')%i', $text ) 317 317 ) { 318 318 return "<a {$text}>"; … … 393 393 394 394 // Cleanup of accidental links within links 395 return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a>([^<]*)</a>#i', "$1$3$4</a>", $r );395 return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a>([^<]*)</a>#i', '$1$3$4</a>', $r ); 396 396 } 397 397 -
trunk/src/includes/common/functions.php
r6974 r7006 177 177 // Is the post by an anonymous user? 178 178 if ( ( bbp_get_topic_post_type() === $data['post_type'] && ! bbp_is_topic_anonymous( $postarr['ID'] ) ) || 179 179 ( bbp_get_reply_post_type() === $data['post_type'] && ! bbp_is_reply_anonymous( $postarr['ID'] ) ) ) { 180 180 return $data; 181 181 } … … 223 223 $lockable = "+{$minutes} minutes"; 224 224 if ( true === $utc ) { 225 $lockable .= " UTC";225 $lockable .= ' UTC'; 226 226 } 227 227 … … 714 714 // Prepare duplicate check query 715 715 $query = "SELECT ID FROM {$bbp_db->posts} {$join}"; 716 $query .= $bbp_db->prepare( "WHERE post_type = %s AND post_status != %s AND post_author = %d AND post_content = %s", $r['post_type'], $r['post_status'], $r['post_author'], $r['post_content'] );716 $query .= $bbp_db->prepare('WHERE post_type = %s AND post_status != %s AND post_author = %d AND post_content = %s', $r['post_type'], $r['post_status'], $r['post_author'], $r['post_content'] ); 717 717 $query .= ! empty( $r['post_parent'] ) 718 ? $bbp_db->prepare( " AND post_parent = %d", $r['post_parent'] )718 ? $bbp_db->prepare( ' AND post_parent = %d', $r['post_parent'] ) 719 719 : ''; 720 720 $query .= $where; 721 $query .= " LIMIT 1";721 $query .= ' LIMIT 1'; 722 722 $dupe = apply_filters( 'bbp_check_for_duplicate_query', $query, $r ); 723 723 … … 1149 1149 // Custom headers 1150 1150 $headers = apply_filters( 'bbp_subscription_mail_headers', $headers ); 1151 1151 $to_email = apply_filters( 'bbp_subscription_to_email', $no_reply ); 1152 1152 1153 1153 // Before … … 2448 2448 $the_query = array( 2449 2449 'posts_per_page' => bbp_get_replies_per_rss_page(), 2450 'meta_query' => array( array( 2450 'meta_query' => array( array() ), 2451 2451 'feed' => true 2452 2452 ); -
trunk/src/includes/common/template.php
r6930 r7006 2085 2085 * @return bool True if match, false if not 2086 2086 */ 2087 function bbp_is_query_name( $name = '' ) 2087 function bbp_is_query_name( $name = '' ) { 2088 2088 return (bool) ( bbp_get_query_name() === $name ); 2089 2089 } … … 2096 2096 * @return string To return the query var value 2097 2097 */ 2098 function bbp_get_query_name() 2098 function bbp_get_query_name() { 2099 2099 return get_query_var( '_bbp_query_name' ); 2100 2100 } … … 2107 2107 * @param string $name What to set the query var to 2108 2108 */ 2109 function bbp_set_query_name( $name = '' ) 2109 function bbp_set_query_name( $name = '' ) { 2110 2110 set_query_var( '_bbp_query_name', $name ); 2111 2111 } … … 2413 2413 2414 2414 // Build the trail 2415 $trail = ! empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'] 2415 $trail = ! empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'], $crumbs ) . $r['crumb_after'] . $r['after'] ) : ''; 2416 2416 2417 2417 // Filter & return -
trunk/src/includes/core/template-functions.php
r6930 r7006 383 383 384 384 // Filter & return 385 return (array) apply_filters( 'bbp_get_template_stack', $stack ) 385 return (array) apply_filters( 'bbp_get_template_stack', $stack ); 386 386 } 387 387 -
trunk/src/includes/core/template-loader.php
r6573 r7006 30 30 31 31 // Editing a user 32 if ( bbp_is_single_user_edit() && ( $new_template = bbp_get_single_user_edit_template() ) ) : 32 if ( bbp_is_single_user_edit() && ( $new_template = bbp_get_single_user_edit_template() ) ) : //phpcs:ignore 33 33 34 34 // User favorites -
trunk/src/includes/core/theme-compat.php
r6884 r7006 56 56 * @param array $properties 57 57 */ 58 public function __construct( Array $properties = array() ) {58 public function __construct( array $properties = array() ) { 59 59 $this->_data = $properties; 60 60 } -
trunk/src/includes/extend/buddypress/groups.php
r6967 r7006 323 323 public function edit_screen( $group = false ) { 324 324 $forum_id = 0; 325 $group_id = empty( $group->id ) ? bp_get_new_group_id() : $group->id 325 $group_id = empty( $group->id ) ? bp_get_new_group_id() : $group->id; 326 326 $forum_ids = bbp_get_group_forum_ids( $group_id ); 327 327 … … 400 400 bbp_add_error( 'bbp_edit_group_forum_screen_save', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 401 401 return; 402 402 } 403 403 404 404 $edit_forum = ! empty( $_POST['bbp-edit-group-forum'] ) ? true : false; … … 963 963 964 964 // Single Topic 965 else :965 else : 966 966 bbp_set_query_name( 'bbp_single_topic' ); 967 967 bbp_get_template_part( 'content', 'single-topic' ); -
trunk/src/includes/extend/buddypress/loader.php
r6807 r7006 243 243 244 244 // Favorite topics 245 if ( bbp_is_favorites_active() ) {245 if ( bbp_is_favorites_active() ) { 246 246 $sub_nav[] = array( 247 247 'name' => esc_html__( 'Favorites', 'bbpress' ), … … 380 380 'type' => 'thumb' 381 381 ) ); 382 $bp->bp_options_title = bp_get_displayed_user_fullname();382 $bp->bp_options_title = bp_get_displayed_user_fullname(); 383 383 } 384 384 } -
trunk/src/includes/extend/buddypress/notifications.php
r6981 r7006 93 93 $filter = 'bbp_single_new_subscription_notification'; 94 94 $text = ! empty( $secondary_item_id ) 95 ? sprintf( esc_html__( 'You have % d new reply to %2$s from %3$s', 'bbpress' ), $action_item_count, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) )96 : sprintf( esc_html__( 'You have % d new reply to %s', 'bbpress' ), $action_item_count, $topic_title );95 ? sprintf( esc_html__( 'You have %1$d new reply to %2$s from %3$s', 'bbpress' ), $action_item_count, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) ) 96 : sprintf( esc_html__( 'You have %1$d new reply to %2$s', 'bbpress' ), $action_item_count, $topic_title ); 97 97 } 98 98 … … 155 155 // Notify the topic author if not the current reply author 156 156 if ( $author_id !== $topic_author_id ) { 157 $args['secondary_item_id'] = $secondary_item_id 157 $args['secondary_item_id'] = $secondary_item_id; 158 158 159 159 bp_notifications_add_notification( $args ); -
trunk/src/includes/forums/template.php
r6941 r7006 1172 1172 // First link never has view=all 1173 1173 $retval = bbp_get_view_all( 'edit_others_topics' ) 1174 ? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $topics ) . "</a>"1174 ? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $topics ) . '</a>' 1175 1175 : esc_html( $topics ); 1176 1176 … … 1187 1187 // Hidden link 1188 1188 $retval .= ! bbp_get_view_all( 'edit_others_topics' ) 1189 ? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . "</a>"1189 ? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . '</a>' 1190 1190 : " {$extra}"; 1191 1191 } … … 1571 1571 1572 1572 // Adjust the ancestor check based on the count 1573 switch ( $operator ) {1573 switch ( $operator ) { 1574 1574 default: 1575 1575 case 'AND': … … 2391 2391 ob_start(); ?> 2392 2392 2393 <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] )?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>2393 <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>> 2394 2394 2395 2395 <?php foreach ( bbp_get_forum_types( $r['forum_id'] ) as $key => $label ) : ?> … … 2477 2477 ob_start(); ?> 2478 2478 2479 <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] )?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>2479 <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>> 2480 2480 2481 2481 <?php foreach ( bbp_get_forum_statuses( $r['forum_id'] ) as $key => $label ) : ?> … … 2563 2563 ob_start(); ?> 2564 2564 2565 <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] )?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>2565 <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>> 2566 2566 2567 2567 <?php foreach ( bbp_get_forum_visibilities( $r['forum_id'] ) as $key => $label ) : ?> -
trunk/src/includes/replies/functions.php
r6923 r7006 717 717 718 718 // Update counts, etc... 719 do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author 719 do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author, true, $reply_to ); 720 720 721 721 /** Revisions *********************************************************/ … … 731 731 732 732 // Update revision log 733 if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( "1"=== $_POST['bbp_log_reply_edit'] ) ) {733 if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( '1' === $_POST['bbp_log_reply_edit'] ) ) { 734 734 $revision_id = wp_save_post_revision( $reply_id ); 735 735 if ( ! empty( $revision_id ) ) { … … 822 822 set_transient( '_bbp_' . bbp_current_author_ip() . '_last_posted', time() ); 823 823 } 824 825 824 } else { 826 825 if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) { … … 2080 2079 // The texts to search for 2081 2080 $search = array( 2082 "FROM {$table_name} " 2081 "FROM {$table_name} ", 2083 2082 "WHERE 1=1 AND {$table_name}.post_parent = {$topic_id}", 2084 2083 ") AND {$table_name}.post_parent = {$topic_id}" … … 2087 2086 // The texts to replace them with 2088 2087 $replace = array( 2089 $search[0] . "FORCE INDEX (PRIMARY, post_parent) ",2088 $search[0] . 'FORCE INDEX (PRIMARY, post_parent) ', 2090 2089 "WHERE 1=1 AND ({$table_name}.ID = {$topic_id} OR {$table_name}.post_parent = {$topic_id})", 2091 2090 ") AND ({$table_name}.ID = {$topic_id} OR {$table_name}.post_parent = {$topic_id})" … … 2147 2146 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" /> 2148 2147 <link><?php self_link(); ?></link> 2149 <description><?php //?></description> 2148 <description><?php //?></description><?php // phpcs:ignore ?> 2150 2149 <lastBuildDate><?php echo date( 'r' ); ?></lastBuildDate> 2151 2150 <generator><?php echo esc_url_raw( 'https://bbpress.org/?v=' . convert_chars( bbp_get_version() ) ); ?></generator> … … 2190 2189 <link><?php bbp_reply_url(); ?></link> 2191 2190 <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate> 2192 <dc:creator><?php the_author() ?></dc:creator>2191 <dc:creator><?php the_author(); ?></dc:creator> 2193 2192 2194 2193 <description> -
trunk/src/includes/replies/template.php
r6967 r7006 1529 1529 * Return the reply to id of a reply 1530 1530 * 1531 1531 * @since 2.4.0 bbPress (r4944) 1532 1532 * 1533 1533 * @param int $reply_id Optional. Reply id … … 2387 2387 // Several replies in a topic with several pages 2388 2388 } else { 2389 $retstr = sprintf( _n( 'Viewing %2$s replies (of %4$s total)', 'Viewing %1$s replies - %2$s through %3$s (of %4$s total)', $count_int, 'bbpress' ), $count_num, $from_num, $to_num, $total_num ); 2389 $retstr = sprintf( _n( 'Viewing %2$s replies (of %4$s total)', 'Viewing %1$s replies - %2$s through %3$s (of %4$s total)', $count_int, 'bbpress' ), $count_num, $from_num, $to_num, $total_num ); //phpcs:ignore 2390 2390 } 2391 2391 … … 2399 2399 // Several posts in a topic with several pages 2400 2400 } else { 2401 $retstr = sprintf( _n( 'Viewing %2$s post (of %4$s total)', 'Viewing %1$s posts - %2$s through %3$s (of %4$s total)', $count_int, 'bbpress' ), $count_num, $from_num, $to_num, $total_num ); 2401 $retstr = sprintf( _n( 'Viewing %2$s post (of %4$s total)', 'Viewing %1$s posts - %2$s through %3$s (of %4$s total)', $count_int, 'bbpress' ), $count_num, $from_num, $to_num, $total_num ); //phpcs:ignore 2402 2402 } 2403 2403 } … … 2712 2712 ob_start(); ?> 2713 2713 2714 <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>2714 <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>> 2715 2715 2716 2716 <?php foreach ( bbp_get_reply_statuses( $r['reply_id'] ) as $key => $label ) : ?> -
trunk/src/includes/search/template.php
r6903 r7006 413 413 // Several pages of results 414 414 } else { 415 $retstr = sprintf( _n( 'Viewing %2$s results (of %4$s total)', 'Viewing %1$s results - %2$s through %3$s (of %4$s total)', $bbp->search_query->post_count, 'bbpress' ), $bbp->search_query->post_count, $from_num, $to_num, $total_num ); 415 $retstr = sprintf( _n( 'Viewing %2$s results (of %4$s total)', 'Viewing %1$s results - %2$s through %3$s (of %4$s total)', $bbp->search_query->post_count, 'bbpress' ), $bbp->search_query->post_count, $from_num, $to_num, $total_num ); //phpcs:ignore 416 416 } 417 417 -
trunk/src/includes/topics/functions.php
r6923 r7006 647 647 648 648 // Update counts, etc... 649 do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic_author 649 do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic_author, true /* Is edit */ ); 650 650 651 651 /** Revisions *********************************************************/ … … 661 661 662 662 // Update revision log 663 if ( ! empty( $_POST['bbp_log_topic_edit'] ) && ( "1" === $_POST['bbp_log_topic_edit'] ) ){663 if ( ! empty( $_POST['bbp_log_topic_edit'] ) && ( '1' === $_POST['bbp_log_topic_edit'] ) ) { 664 664 $revision_id = wp_save_post_revision( $topic_id ); 665 665 if ( ! empty( $revision_id ) ) { … … 790 790 } 791 791 792 // If not anonymous, then 792 793 } else { 793 794 if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) { … … 868 869 869 870 // Get the forum ID if none was passed 870 if ( empty( $forum_id ) 871 if ( empty( $forum_id ) ) { 871 872 $forum_id = bbp_get_topic_forum_id( $topic_id ); 872 873 } … … 1195 1196 1196 1197 // Shift the tags if told to 1197 if ( ! empty( $_POST['bbp_topic_tags'] ) && ( "1"=== $_POST['bbp_topic_tags'] ) ) {1198 if ( ! empty( $_POST['bbp_topic_tags'] ) && ( '1' === $_POST['bbp_topic_tags'] ) ) { 1198 1199 wp_set_post_terms( $destination_topic->ID, $source_topic_tags, bbp_get_topic_tag_tax_id(), true ); 1199 1200 } … … 1488 1489 1489 1490 // Copy the subscribers 1490 if ( ! empty( $_POST['bbp_topic_subscribers'] ) && "1"=== $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {1491 if ( ! empty( $_POST['bbp_topic_subscribers'] ) && '1' === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) { 1491 1492 1492 1493 // Get the subscribers … … 1505 1506 1506 1507 // Copy the favoriters if told to 1507 if ( ! empty( $_POST['bbp_topic_favoriters'] ) && ( "1"=== $_POST['bbp_topic_favoriters'] ) ) {1508 if ( ! empty( $_POST['bbp_topic_favoriters'] ) && ( '1' === $_POST['bbp_topic_favoriters'] ) ) { 1508 1509 1509 1510 // Get the favoriters … … 1522 1523 1523 1524 // Copy the tags if told to 1524 if ( ! empty( $_POST['bbp_topic_tags'] ) && ( "1"=== $_POST['bbp_topic_tags'] ) ) {1525 if ( ! empty( $_POST['bbp_topic_tags'] ) && ( '1' === $_POST['bbp_topic_tags'] ) ) { 1525 1526 1526 1527 // Get the source topic tags … … 2135 2136 2136 2137 $is_sticky = bbp_is_topic_sticky( $r['id'] ); 2137 $is_super = false === $is_sticky && ! empty( $_GET['super'] ) && ( "1"=== $_GET['super'] ) ? true : false;2138 $is_super = false === $is_sticky && ! empty( $_GET['super'] ) && ( '1' === $_GET['super'] ) ? true : false; 2138 2139 2139 2140 // Toggle … … 3776 3777 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" /> 3777 3778 <link><?php self_link(); ?></link> 3778 <description><?php //?></description> 3779 <description><?php //?></description><?php // phpcs:ignore ?> 3779 3780 <lastBuildDate><?php echo date( 'r' ); ?></lastBuildDate> 3780 3781 <generator><?php echo esc_url_raw( 'https://bbpress.org/?v=' . convert_chars( bbp_get_version() ) ); ?></generator> … … 3792 3793 <link><?php bbp_topic_permalink(); ?></link> 3793 3794 <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_meta( bbp_get_topic_id(), '_bbp_last_active_time', true ), false ); ?></pubDate> 3794 <dc:creator><?php the_author() ?></dc:creator>3795 <dc:creator><?php the_author(); ?></dc:creator> 3795 3796 3796 3797 <?php if ( !post_password_required() ) : ?> -
trunk/src/includes/topics/template.php
r6967 r7006 638 638 // Default to topic post type name label 639 639 } else { 640 $tto 641 $title 640 $tto = get_post_type_object( bbp_get_topic_post_type() ); 641 $title = $tto->labels->name; 642 642 } 643 643 } … … 1468 1468 1469 1469 // Filter sections 1470 $sections 1470 $sections = apply_filters( 'bbp_get_topic_author_links', $author_links, $r, $args ); 1471 1471 1472 1472 // Assemble sections into author link … … 2018 2018 // First link never has view=all 2019 2019 $retval = bbp_get_view_all( 'edit_others_replies' ) 2020 ? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $replies ) . "</a>"2020 ? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $replies ) . '</a>' 2021 2021 : $replies; 2022 2022 … … 2033 2033 // Hidden link 2034 2034 $retval .= ! bbp_get_view_all( 'edit_others_replies' ) 2035 ? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . "</a>"2035 ? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . '</a>' 2036 2036 : " {$extra}"; 2037 2037 } … … 2990 2990 // Several topics in a forum with several pages 2991 2991 } else { 2992 $retstr = sprintf( _n( 'Viewing topic %2$s (of %4$s total)', 'Viewing %1$s topics - %2$s through %3$s (of %4$s total)', $total_int, 'bbpress' ), $count_num, $from_num, $to_num, $total ); 2992 $retstr = sprintf( _n( 'Viewing topic %2$s (of %4$s total)', 'Viewing %1$s topics - %2$s through %3$s (of %4$s total)', $total_int, 'bbpress' ), $count_num, $from_num, $to_num, $total ); //phpcs:ignore 2993 2993 } 2994 2994 … … 3242 3242 ob_start(); ?> 3243 3243 3244 <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>3244 <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>> 3245 3245 3246 3246 <?php foreach ( bbp_get_topic_statuses( $r['topic_id'] ) as $key => $label ) : ?> -
trunk/src/includes/users/capabilities.php
r6734 r7006 486 486 487 487 // Make array of post types to mark as spam 488 $post_types 489 $post_types 488 $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ); 489 $post_types = "'" . implode( "', '", $post_types ) . "'"; 490 490 491 491 // Loop through blogs and remove their posts -
trunk/src/templates/default/bbpress/form-forum.php
r6806 r7006 88 88 89 89 <p class="form-allowed-tags"> 90 <label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br />90 <label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br /> 91 91 <code><?php bbp_allowed_tags(); ?></code> 92 92 </p> -
trunk/src/templates/default/bbpress/form-reply.php
r6806 r7006 77 77 78 78 <p class="form-allowed-tags"> 79 <label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br />79 <label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br /> 80 80 <code><?php bbp_allowed_tags(); ?></code> 81 81 </p> -
trunk/src/templates/default/bbpress/form-search.php
r6806 r7006 2 2 3 3 /** 4 * Search 4 * Search 5 5 * 6 6 * @package bbPress -
trunk/src/templates/default/bbpress/form-user-edit.php
r6806 r7006 15 15 <form id="bbp-your-profile" method="post" enctype="multipart/form-data"> 16 16 17 <h2 class="entry-title"><?php esc_html_e( 'Name', 'bbpress' ) ?></h2>17 <h2 class="entry-title"><?php esc_html_e( 'Name', 'bbpress' ); ?></h2> 18 18 19 19 <?php do_action( 'bbp_user_edit_before' ); ?> 20 20 21 21 <fieldset class="bbp-form"> 22 <legend><?php esc_html_e( 'Name', 'bbpress' ) ?></legend>22 <legend><?php esc_html_e( 'Name', 'bbpress' ); ?></legend> 23 23 24 24 <?php do_action( 'bbp_user_edit_before_name' ); ?> 25 25 26 26 <div> 27 <label for="first_name"><?php esc_html_e( 'First Name', 'bbpress' ) ?></label>27 <label for="first_name"><?php esc_html_e( 'First Name', 'bbpress' ); ?></label> 28 28 <input type="text" name="first_name" id="first_name" value="<?php bbp_displayed_user_field( 'first_name', 'edit' ); ?>" class="regular-text" /> 29 29 </div> 30 30 31 31 <div> 32 <label for="last_name"><?php esc_html_e( 'Last Name', 'bbpress' ) ?></label>32 <label for="last_name"><?php esc_html_e( 'Last Name', 'bbpress' ); ?></label> 33 33 <input type="text" name="last_name" id="last_name" value="<?php bbp_displayed_user_field( 'last_name', 'edit' ); ?>" class="regular-text" /> 34 34 </div> … … 40 40 41 41 <div> 42 <label for="display_name"><?php esc_html_e( 'Display Name', 'bbpress' ) ?></label>42 <label for="display_name"><?php esc_html_e( 'Display Name', 'bbpress' ); ?></label> 43 43 44 44 <?php bbp_edit_user_display_name(); ?> … … 50 50 </fieldset> 51 51 52 <h2 class="entry-title"><?php esc_html_e( 'Contact Info', 'bbpress' ) ?></h2>52 <h2 class="entry-title"><?php esc_html_e( 'Contact Info', 'bbpress' ); ?></h2> 53 53 54 54 <fieldset class="bbp-form"> 55 <legend><?php esc_html_e( 'Contact Info', 'bbpress' ) ?></legend>55 <legend><?php esc_html_e( 'Contact Info', 'bbpress' ); ?></legend> 56 56 57 57 <?php do_action( 'bbp_user_edit_before_contact' ); ?> 58 58 59 59 <div> 60 <label for="url"><?php esc_html_e( 'Website', 'bbpress' ) ?></label>60 <label for="url"><?php esc_html_e( 'Website', 'bbpress' ); ?></label> 61 61 <input type="text" name="url" id="url" value="<?php bbp_displayed_user_field( 'user_url', 'edit' ); ?>" maxlength="200" class="regular-text code" /> 62 62 </div> … … 97 97 </fieldset> 98 98 99 <h2 class="entry-title"><?php esc_html_e( 'Account', 'bbpress' ) ?></h2>99 <h2 class="entry-title"><?php esc_html_e( 'Account', 'bbpress' ); ?></h2> 100 100 101 101 <fieldset class="bbp-form"> 102 <legend><?php esc_html_e( 'Account', 'bbpress' ) ?></legend>102 <legend><?php esc_html_e( 'Account', 'bbpress' ); ?></legend> 103 103 104 104 <?php do_action( 'bbp_user_edit_before_account' ); ?> … … 117 117 118 118 <div> 119 <label for="url"><?php esc_html_e( 'Language', 'bbpress' ) ?></label>119 <label for="url"><?php esc_html_e( 'Language', 'bbpress' ); ?></label> 120 120 121 121 <?php bbp_edit_user_language(); ?> … … 129 129 <?php if ( ! bbp_is_user_home_edit() && current_user_can( 'promote_user', bbp_get_displayed_user_id() ) ) : ?> 130 130 131 <h2 class="entry-title"><?php esc_html_e( 'User Role', 'bbpress' ) ?></h2>131 <h2 class="entry-title"><?php esc_html_e( 'User Role', 'bbpress' ); ?></h2> 132 132 133 133 <fieldset class="bbp-form"> -
trunk/src/templates/default/bbpress/form-user-roles.php
r6258 r7006 14 14 15 15 <div> 16 <label for="role"><?php esc_html_e( 'Blog Role', 'bbpress' ) ?></label>16 <label for="role"><?php esc_html_e( 'Blog Role', 'bbpress' ); ?></label> 17 17 18 18 <?php bbp_edit_user_blog_role(); ?> … … 21 21 22 22 <div> 23 <label for="forum-role"><?php esc_html_e( 'Forum Role', 'bbpress' ) ?></label>23 <label for="forum-role"><?php esc_html_e( 'Forum Role', 'bbpress' ); ?></label> 24 24 25 25 <?php bbp_edit_user_forums_role(); ?> -
trunk/src/templates/default/bbpress/pagination-search.php
r6258 r7006 2 2 3 3 /** 4 * Pagination for pages of search results 4 * Pagination for pages of search results 5 5 * 6 6 * @package bbPress -
trunk/src/templates/default/bbpress/user-details.php
r6574 r7006 26 26 <div id="bbp-user-navigation"> 27 27 <ul> 28 <li class="<?php if ( bbp_is_single_user_profile() ) : ?>current<?php endif; ?>">28 <li class="<?php if ( bbp_is_single_user_profile() ) : ?>current<?php endif; ?>"> 29 29 <span class="vcard bbp-user-profile-link"> 30 30 <a class="url fn n" href="<?php bbp_user_profile_url(); ?>" title="<?php printf( esc_attr__( "%s's Profile", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>" rel="me"><?php esc_html_e( 'Profile', 'bbpress' ); ?></a> … … 32 32 </li> 33 33 34 <li class="<?php if ( bbp_is_single_user_topics() ) : ?>current<?php endif; ?>">34 <li class="<?php if ( bbp_is_single_user_topics() ) : ?>current<?php endif; ?>"> 35 35 <span class='bbp-user-topics-created-link'> 36 36 <a href="<?php bbp_user_topics_created_url(); ?>" title="<?php printf( esc_attr__( "%s's Topics Started", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Topics Started', 'bbpress' ); ?></a> … … 38 38 </li> 39 39 40 <li class="<?php if ( bbp_is_single_user_replies() ) : ?>current<?php endif; ?>">40 <li class="<?php if ( bbp_is_single_user_replies() ) : ?>current<?php endif; ?>"> 41 41 <span class='bbp-user-replies-created-link'> 42 42 <a href="<?php bbp_user_replies_created_url(); ?>" title="<?php printf( esc_attr__( "%s's Replies Created", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Replies Created', 'bbpress' ); ?></a> … … 45 45 46 46 <?php if ( bbp_is_engagements_active() ) : ?> 47 <li class="<?php if ( bbp_is_single_user_engagements() ) : ?>current<?php endif; ?>">47 <li class="<?php if ( bbp_is_single_user_engagements() ) : ?>current<?php endif; ?>"> 48 48 <span class='bbp-user-engagements-created-link'> 49 49 <a href="<?php bbp_user_engagements_url(); ?>" title="<?php printf( esc_attr__( "%s's Engagements", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Engagements', 'bbpress' ); ?></a> … … 53 53 54 54 <?php if ( bbp_is_favorites_active() ) : ?> 55 <li class="<?php if ( bbp_is_favorites() ) : ?>current<?php endif; ?>">55 <li class="<?php if ( bbp_is_favorites() ) : ?>current<?php endif; ?>"> 56 56 <span class="bbp-user-favorites-link"> 57 57 <a href="<?php bbp_favorites_permalink(); ?>" title="<?php printf( esc_attr__( "%s's Favorites", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Favorites', 'bbpress' ); ?></a> … … 63 63 64 64 <?php if ( bbp_is_subscriptions_active() ) : ?> 65 <li class="<?php if ( bbp_is_subscriptions() ) : ?>current<?php endif; ?>">65 <li class="<?php if ( bbp_is_subscriptions() ) : ?>current<?php endif; ?>"> 66 66 <span class="bbp-user-subscriptions-link"> 67 67 <a href="<?php bbp_subscriptions_permalink(); ?>" title="<?php printf( esc_attr__( "%s's Subscriptions", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Subscriptions', 'bbpress' ); ?></a> … … 70 70 <?php endif; ?> 71 71 72 <li class="<?php if ( bbp_is_single_user_edit() ) : ?>current<?php endif; ?>">72 <li class="<?php if ( bbp_is_single_user_edit() ) : ?>current<?php endif; ?>"> 73 73 <span class="bbp-user-edit-link"> 74 74 <a href="<?php bbp_user_profile_edit_url(); ?>" title="<?php printf( esc_attr__( "Edit %s's Profile", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Edit', 'bbpress' ); ?></a> -
trunk/src/templates/default/bbpress/user-profile.php
r6592 r7006 17 17 <div class="bbp-user-section"> 18 18 <h3><?php esc_html_e( 'Profile', 'bbpress' ); ?></h3> 19 <p class="bbp-user-forum-role"><?php 19 <p class="bbp-user-forum-role"><?php printf( esc_html__( 'Registered: %s', 'bbpress' ), bbp_get_time_since( bbp_get_displayed_user_field( 'user_registered' ) ) ); ?></p> 20 20 21 21 <?php if ( bbp_get_displayed_user_field( 'description' ) ) : ?> … … 27 27 <?php if ( bbp_get_displayed_user_field( 'user_url' ) ) : ?> 28 28 29 <p class="bbp-user-website"><?php 29 <p class="bbp-user-website"><?php printf( esc_html__( 'Website: %s', 'bbpress' ), bbp_rel_nofollow( bbp_make_clickable( bbp_get_displayed_user_field( 'user_url' ) ) ) ); ?></p> 30 30 31 31 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.