Ticket #2677: 2677.diff
File 2677.diff, 9.0 KB (added by , 10 years ago) |
---|
-
src/includes/admin/metaboxes.php
369 369 <input name="menu_order" type="number" step="1" size="4" id="menu_order" value="<?php echo esc_attr( $menu_order ); ?>" /> 370 370 </p> 371 371 372 <input name="ping_status" type="hidden" id="ping_status" value=" open" />372 <input name="ping_status" type="hidden" id="ping_status" value="closed" /> 373 373 374 374 <?php 375 375 wp_nonce_field( 'bbp_forum_metabox_save', 'bbp_forum_metabox' ); … … 445 445 ) ); ?> 446 446 </p> 447 447 448 <input name="ping_status" type="hidden" id="ping_status" value=" open" />448 <input name="ping_status" type="hidden" id="ping_status" value="closed" /> 449 449 450 450 <?php 451 451 wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' ); … … 539 539 <?php bbp_reply_to_dropdown( $post_id ); ?> 540 540 </p> 541 541 542 <input name="ping_status" type="hidden" id="ping_status" value=" open" />542 <input name="ping_status" type="hidden" id="ping_status" value="closed" /> 543 543 544 544 <?php 545 545 wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' ); -
src/includes/core/filters.php
54 54 // Force comments_status on bbPress post types 55 55 add_filter( 'comments_open', 'bbp_force_comment_status' ); 56 56 57 // Force ping_status on bbPress post types 58 add_filter( 'pings_open', 'bbp_force_ping_status' ); 59 57 60 // Add post_parent__in to posts_where 58 61 add_filter( 'posts_where', 'bbp_query_post_parent__in', 10, 2 ); 59 62 -
src/includes/core/theme-compat.php
357 357 'menu_order' => 0, 358 358 'pinged' => '', 359 359 'to_ping' => '', 360 'ping_status' => ' ',360 'ping_status' => 'closed', 361 361 'comment_status' => 'closed', 362 362 'comment_count' => 0, 363 363 'filter' => 'raw', … … 435 435 * @uses bbp_set_theme_compat_template() To set the global theme compat template 436 436 */ 437 437 function bbp_template_include_theme_compat( $template = '' ) { 438 438 439 439 /** 440 440 * Bail if a root template was already found. This prevents unintended 441 441 * recursive filtering of 'the_content'. … … 480 480 'post_title' => bbp_get_displayed_user_field( 'display_name' ), 481 481 'post_status' => bbp_get_public_status_id(), 482 482 'is_archive' => false, 483 'comment_status' => 'closed' 483 'comment_status' => 'closed', 484 'ping_status' => 'closed' 484 485 ) ); 485 486 486 487 /** Forums ************************************************************/ … … 535 536 'post_type' => bbp_get_forum_post_type(), 536 537 'post_status' => bbp_get_public_status_id(), 537 538 'is_archive' => true, 538 'comment_status' => 'closed' 539 'comment_status' => 'closed', 540 'ping_status' => 'closed' 539 541 ) ); 540 542 541 543 // Single Forum … … 551 553 'post_type' => bbp_get_forum_post_type(), 552 554 'post_status' => bbp_get_forum_visibility(), 553 555 'is_single' => true, 554 'comment_status' => 'closed' 556 'comment_status' => 'closed', 557 'ping_status' => 'closed' 555 558 ) ); 556 559 557 560 } elseif ( bbp_is_single_forum() ) { … … 566 569 'post_type' => bbp_get_forum_post_type(), 567 570 'post_status' => bbp_get_forum_visibility(), 568 571 'is_single' => true, 569 'comment_status' => 'closed' 572 'comment_status' => 'closed', 573 'ping_status' => 'closed' 570 574 ) ); 571 575 572 576 /** Topics ************************************************************/ … … 605 609 'post_type' => bbp_get_topic_post_type(), 606 610 'post_status' => bbp_get_public_status_id(), 607 611 'is_archive' => true, 608 'comment_status' => 'closed' 612 'comment_status' => 'closed', 613 'ping_status' => 'closed' 609 614 ) ); 610 615 611 616 // Single Topic … … 638 643 'post_type' => bbp_get_topic_post_type(), 639 644 'post_status' => bbp_get_topic_status(), 640 645 'is_single' => true, 641 'comment_status' => 'closed' 646 'comment_status' => 'closed', 647 'ping_status' => 'closed' 642 648 ) ); 643 649 644 650 /** Replies ***********************************************************/ … … 655 661 'post_content' => $bbp_shortcodes->display_reply_index(), 656 662 'post_type' => bbp_get_reply_post_type(), 657 663 'post_status' => bbp_get_public_status_id(), 658 'comment_status' => 'closed' 664 'comment_status' => 'closed', 665 'ping_status' => 'closed' 659 666 ) ); 660 667 661 668 // Single Reply … … 683 690 'post_content' => $new_content, 684 691 'post_type' => bbp_get_reply_post_type(), 685 692 'post_status' => bbp_get_reply_status(), 686 'comment_status' => 'closed' 693 'comment_status' => 'closed', 694 'ping_status' => 'closed' 687 695 ) ); 688 696 689 697 /** Views *************************************************************/ … … 699 707 'post_content' => $bbp_shortcodes->display_view( array( 'id' => get_query_var( bbp_get_view_rewrite_id() ) ) ), 700 708 'post_type' => '', 701 709 'post_status' => bbp_get_public_status_id(), 702 'comment_status' => 'closed' 710 'comment_status' => 'closed', 711 'ping_status' => 'closed' 703 712 ) ); 704 713 705 714 /** Search ************************************************************/ … … 715 724 'post_content' => $bbp_shortcodes->display_search( array( 'search' => get_query_var( bbp_get_search_rewrite_id() ) ) ), 716 725 'post_type' => '', 717 726 'post_status' => bbp_get_public_status_id(), 718 'comment_status' => 'closed' 727 'comment_status' => 'closed', 728 'ping_status' => 'closed' 719 729 ) ); 720 730 721 731 /** Topic Tags ********************************************************/ … … 745 755 'post_title' => sprintf( __( 'Topic Tag: %s', 'bbpress' ), '<span>' . bbp_get_topic_tag_name() . '</span>' ), 746 756 'post_status' => bbp_get_public_status_id(), 747 757 'comment_status' => 'closed', 758 'ping_status' => 'closed', 748 759 'is_tax' => true 749 760 ) ); 750 761 } … … 979 990 // Allow override of the override 980 991 return apply_filters( 'bbp_force_comment_status', $retval, $open, $post_id, $post_type ); 981 992 } 993 994 /** 995 * Force ping_status to 'closed' for bbPress post types 996 * 997 * @since bbPress (rXXXX) 998 * 999 * @param bool $open True if open, false if closed 1000 * @param int $post_id ID of the post to check 1001 * @return bool True if open, false if closed 1002 */ 1003 function bbp_force_ping_status( $open, $post_id = 0 ) { 1004 1005 // Get the post type of the post ID 1006 $post_type = get_post_type( $post_id ); 1007 1008 // Default return value is what is passed in $open 1009 $retval = $open; 1010 1011 // Only force for bbPress post types 1012 switch ( $post_type ) { 1013 case bbp_get_forum_post_type() : 1014 case bbp_get_topic_post_type() : 1015 case bbp_get_reply_post_type() : 1016 $retval = false; 1017 break; 1018 } 1019 1020 // Allow override of the override 1021 return apply_filters( 'bbp_force_ping_status', $retval, $open, $post_id, $post_type ); 1022 } -
src/includes/replies/functions.php
38 38 'post_content' => '', 39 39 'post_title' => '', 40 40 'menu_order' => 0, 41 'comment_status' => 'closed' 41 'comment_status' => 'closed', 42 'ping_status' => 'closed' 42 43 ), 'insert_reply' ); 43 44 44 45 // Insert reply … … 361 362 'post_parent' => $topic_id, 362 363 'post_type' => bbp_get_reply_post_type(), 363 364 'comment_status' => 'closed', 365 'ping_status' => 'closed', 364 366 'menu_order' => bbp_get_topic_reply_count( $topic_id, true ) + 1 365 367 ) ); 366 368 … … 1163 1165 * @return array 1164 1166 */ 1165 1167 function bbp_get_reply_ancestors( $reply_id = 0 ) { 1166 1168 1167 1169 // Validation 1168 1170 $reply_id = bbp_get_reply_id( $reply_id ); 1169 1171 $ancestors = array(); … … 1469 1471 } 1470 1472 1471 1473 // Remove reply_to from moved reply 1472 delete_post_meta( $move_reply->ID, '_bbp_reply_to' ); 1474 delete_post_meta( $move_reply->ID, '_bbp_reply_to' ); 1473 1475 1474 1476 // It is a new topic and we need to set some default metas to make 1475 1477 // the topic display in bbp_has_topics() list … … 2334 2336 2335 2337 /** 2336 2338 * Validate a `reply_to` field for hierarchical replies 2337 * 2339 * 2338 2340 * Checks for 2 scenarios: 2339 2341 * -- The reply to ID is actually a reply 2340 2342 * -- The reply to ID does not match the current reply -
src/includes/topics/functions.php
38 38 'post_content' => '', 39 39 'post_title' => '', 40 40 'comment_status' => 'closed', 41 'ping_status' => 'closed', 41 42 'menu_order' => 0, 42 43 ), 'insert_topic' ); 43 44 … … 330 331 'post_parent' => $forum_id, 331 332 'post_type' => bbp_get_topic_post_type(), 332 333 'tax_input' => $terms, 333 'comment_status' => 'closed' 334 'comment_status' => 'closed', 335 'ping_status' => 'closed' 334 336 ) ); 335 337 336 338 // Insert topic