Changeset 6341
- Timestamp:
- 03/02/2017 04:46:00 AM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bbpress.php
r6339 r6341 334 334 require $this->includes_dir . 'common/formatting.php'; 335 335 require $this->includes_dir . 'common/locale.php'; 336 require $this->includes_dir . 'common/locks.php'; 336 337 require $this->includes_dir . 'common/template.php'; 337 338 require $this->includes_dir . 'common/widgets.php'; -
trunk/src/includes/core/theme-compat.php
r6314 r6341 578 578 ) ); 579 579 580 // Lock the forum from other edits 581 bbp_set_post_lock( bbp_get_forum_id() ); 582 580 583 } elseif ( bbp_is_single_forum() ) { 581 584 … … 644 647 645 648 // Edit 646 } elseif ( bbp_is_topic_edit() ) { 649 } elseif ( bbp_is_topic_edit() ) { 647 650 $new_content = $bbp_shortcodes->display_topic_form(); 651 652 // Lock the topic from other edits 653 bbp_set_post_lock( bbp_get_topic_id() ); 648 654 649 655 // Single … … 694 700 $new_content = $bbp_shortcodes->display_reply_form(); 695 701 702 // Lock the topic from other edits 703 bbp_set_post_lock( bbp_get_reply_id() ); 704 696 705 // Single 697 706 } else { -
trunk/src/includes/forums/functions.php
r6219 r6341 528 528 $forum_id = wp_update_post( $forum_data ); 529 529 530 /** Revisions *************************************************************/531 532 /**533 * @todo omitted for 2.1534 // Revision Reason535 if ( ! empty( $_POST['bbp_forum_edit_reason'] ) )536 $forum_edit_reason = sanitize_text_field( $_POST['bbp_forum_edit_reason'] );537 538 // Update revision log539 if ( ! empty( $_POST['bbp_log_forum_edit'] ) && ( "1" === $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) {540 bbp_update_forum_revision_log( array(541 'forum_id' => $forum_id,542 'revision_id' => $revision_id,543 'author_id' => bbp_get_current_user_id(),544 'reason' => $forum_edit_reason545 ) );546 }547 */548 549 530 /** No Errors *************************************************************/ 550 531 … … 563 544 ) ); 564 545 546 /** Revisions *********************************************************/ 547 548 // Update locks 549 update_post_meta( $forum_id, '_edit_last', bbp_get_current_user_id() ); 550 delete_post_meta( $forum_id, '_edit_lock' ); 551 552 /** 553 * @todo omitted for now 554 // Revision Reason 555 if ( ! empty( $_POST['bbp_forum_edit_reason'] ) ) 556 $forum_edit_reason = sanitize_text_field( $_POST['bbp_forum_edit_reason'] ); 557 558 // Update revision log 559 if ( ! empty( $_POST['bbp_log_forum_edit'] ) && ( "1" === $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) { 560 bbp_update_forum_revision_log( array( 561 'forum_id' => $forum_id, 562 'revision_id' => $revision_id, 563 'author_id' => bbp_get_current_user_id(), 564 'reason' => $forum_edit_reason 565 ) ); 566 } 567 565 568 // If the new forum parent id is not equal to the old forum parent 566 569 // id, run the bbp_move_forum action and pass the forum's parent id 567 // as the first arg and new forum parent id as the second.570 // as the first argument and new forum parent id as the second. 568 571 // @todo implement 569 //if ( $forum_id !== $forum->post_parent ) 570 // bbp_move_forum_handler( $forum_parent_id, $forum->post_parent, $forum_id ); 572 if ( $forum_id !== $forum->post_parent ) { 573 bbp_move_forum_handler( $forum_parent_id, $forum->post_parent, $forum_id ); 574 } 575 576 */ 571 577 572 578 /** Additional Actions (After Save) ***********************************/ -
trunk/src/includes/replies/functions.php
r6330 r6341 728 728 } 729 729 730 // Insert topic730 // Insert reply 731 731 $reply_id = wp_update_post( $reply_data ); 732 732 … … 750 750 } 751 751 752 /** Revisions *************************************************************/753 754 // Revision Reason755 if ( ! empty( $_POST['bbp_reply_edit_reason'] ) ) {756 $reply_edit_reason = sanitize_text_field( $_POST['bbp_reply_edit_reason'] );757 }758 759 // Update revision log760 if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( "1" === $_POST['bbp_log_reply_edit'] ) ) {761 $revision_id = wp_save_post_revision( $reply_id );762 if ( ! empty( $revision_id ) ) {763 bbp_update_reply_revision_log( array(764 'reply_id' => $reply_id,765 'revision_id' => $revision_id,766 'author_id' => bbp_get_current_user_id(),767 'reason' => $reply_edit_reason768 ) );769 }770 }771 772 752 /** No Errors *************************************************************/ 773 753 … … 776 756 // Update counts, etc... 777 757 do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author , true, $reply_to ); 758 759 /** Revisions *********************************************************/ 760 761 // Update locks 762 update_post_meta( $reply_id, '_edit_last', bbp_get_current_user_id() ); 763 delete_post_meta( $reply_id, '_edit_lock' ); 764 765 // Revision Reason 766 if ( ! empty( $_POST['bbp_reply_edit_reason'] ) ) { 767 $reply_edit_reason = sanitize_text_field( $_POST['bbp_reply_edit_reason'] ); 768 } 769 770 // Update revision log 771 if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( "1" === $_POST['bbp_log_reply_edit'] ) ) { 772 $revision_id = wp_save_post_revision( $reply_id ); 773 if ( ! empty( $revision_id ) ) { 774 bbp_update_reply_revision_log( array( 775 'reply_id' => $reply_id, 776 'revision_id' => $revision_id, 777 'author_id' => bbp_get_current_user_id(), 778 'reason' => $reply_edit_reason 779 ) ); 780 } 781 } 778 782 779 783 /** Additional Actions (After Save) ***********************************/ -
trunk/src/includes/topics/functions.php
r6330 r6341 705 705 /** Revisions *********************************************************/ 706 706 707 // Update locks 708 update_post_meta( $topic_id, '_edit_last', bbp_get_current_user_id() ); 709 delete_post_meta( $topic_id, '_edit_lock' ); 710 707 711 // Revision Reason 708 712 if ( ! empty( $_POST['bbp_topic_edit_reason'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.