Changeset 4426
- Timestamp:
- 11/16/2012 02:07:37 AM (11 years ago)
- Location:
- trunk/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/replies/functions.php
r4331 r4426 365 365 * @uses bbp_has_errors() To get the {@link WP_Error} errors 366 366 * @uses wp_save_post_revision() To save a reply revision 367 * @uses bbp_update_ topic_revision_log() To update the reply revision log367 * @uses bbp_update_reply_revision_log() To update the reply revision log 368 368 * @uses wp_update_post() To update the reply 369 369 * @uses bbp_get_reply_topic_id() To get the reply topic id … … 387 387 388 388 // Define local variable(s) 389 $revisions_removed = false; 389 390 $reply = $reply_id = $reply_author = $topic_id = $forum_id = $anonymous_data = 0; 390 391 $reply_title = $reply_content = $reply_edit_reason = $terms = ''; … … 548 549 ) ); 549 550 550 // Insert reply 551 // Toggle revisions to avoid duplicates 552 if ( post_type_supports( bbp_get_topic_post_type(), 'revisions' ) ) { 553 $revisions_removed = true; 554 remove_post_type_support( bbp_get_topic_post_type(), 'revisions' ); 555 } 556 557 // Insert topic 551 558 $reply_id = wp_update_post( $reply_data ); 559 560 // Toggle revisions back on 561 if ( true === $revisions_removed ) { 562 $revisions_removed = true; 563 add_post_type_support( bbp_get_topic_post_type(), 'revisions' ); 564 } 552 565 553 566 /** Topic Tags ************************************************************/ … … 572 585 // Update revision log 573 586 if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( 1 == $_POST['bbp_log_reply_edit'] ) ) { 574 $revision_id = wp_ save_post_revision( $reply_id );587 $revision_id = wp_is_post_revision( $reply_id ); 575 588 if ( !empty( $revision_id ) ) { 576 589 bbp_update_reply_revision_log( array( -
trunk/includes/topics/functions.php
r4362 r4426 434 434 435 435 // Define local variable(s) 436 $revisions_removed = false; 436 437 $topic = $topic_id = $topic_author = $forum_id = $anonymous_data = 0; 437 438 $topic_title = $topic_content = $topic_edit_reason = ''; … … 614 615 ) ); 615 616 617 // Toggle revisions to avoid duplicates 618 if ( post_type_supports( bbp_get_topic_post_type(), 'revisions' ) ) { 619 $revisions_removed = true; 620 remove_post_type_support( bbp_get_topic_post_type(), 'revisions' ); 621 } 622 616 623 // Insert topic 617 624 $topic_id = wp_update_post( $topic_data ); 625 626 // Toggle revisions back on 627 if ( true === $revisions_removed ) { 628 $revisions_removed = true; 629 add_post_type_support( bbp_get_topic_post_type(), 'revisions' ); 630 } 618 631 619 632 /** Stickies **************************************************************/ … … 649 662 650 663 // Update revision log 651 if ( !empty( $_POST['bbp_log_topic_edit'] ) && ( 1 == $_POST['bbp_log_topic_edit'] ) && ( $revision_id = wp_save_post_revision( $topic_id ) ) ) { 652 bbp_update_topic_revision_log( array( 653 'topic_id' => $topic_id, 654 'revision_id' => $revision_id, 655 'author_id' => bbp_get_current_user_id(), 656 'reason' => $topic_edit_reason 657 ) ); 664 if ( !empty( $_POST['bbp_log_topic_edit'] ) && ( 1 == $_POST['bbp_log_topic_edit'] ) ) { 665 $revision_id = wp_save_post_revision( $topic_id ); 666 if ( ! empty( $revision_id ) ) { 667 bbp_update_topic_revision_log( array( 668 'topic_id' => $topic_id, 669 'revision_id' => $revision_id, 670 'author_id' => bbp_get_current_user_id(), 671 'reason' => $topic_edit_reason 672 ) ); 673 } 658 674 } 659 675
Note: See TracChangeset
for help on using the changeset viewer.