Changeset 4042 for branches/plugin/bbp-includes/bbp-topic-functions.php
- Timestamp:
- 07/02/2012 12:39:16 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-functions.php
r4041 r4042 259 259 } 260 260 261 /** Additional Actions (Before Save) **************************************/ 262 263 do_action( 'bbp_new_topic_pre_extras', $forum_id ); 264 261 265 // Bail if errors 262 266 if ( bbp_has_errors() ) … … 264 268 265 269 /** No Errors *************************************************************/ 266 267 do_action( 'bbp_new_topic_pre_extras', $forum_id );268 270 269 271 // Add the content of the form to $topic_data as an array. … … 574 576 /** No Errors *************************************************************/ 575 577 576 /** Stickies **********************************************************/577 578 if ( !empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) {579 580 // What's the dilly?581 switch ( $_POST['bbp_stick_topic'] ) {582 583 // Sticky in forum584 case 'stick' :585 bbp_stick_topic( $topic_id );586 break;587 588 // Sticky in all forums589 case 'super' :590 bbp_stick_topic( $topic_id, true );591 break;592 593 // Normal594 case 'unstick' :595 default :596 bbp_unstick_topic( $topic_id );597 break;598 }599 }600 601 /** Update the topic ******************************************************/602 603 578 // Add the content of the form to $topic_data as an array 604 579 // Just in time manipulation of topic data before being edited … … 609 584 'post_status' => $post_status, 610 585 'post_parent' => $forum_id, 586 'post_author' => $topic->post_author, 587 'post_type' => bbp_get_topic_post_type(), 611 588 'tax_input' => $terms, 612 589 ) ); … … 614 591 // Insert topic 615 592 $topic_id = wp_update_post( $topic_data ); 593 594 /** Stickies **************************************************************/ 595 596 if ( !empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) { 597 598 // What's the dilly? 599 switch ( $_POST['bbp_stick_topic'] ) { 600 601 // Sticky in forum 602 case 'stick' : 603 bbp_stick_topic( $topic_id ); 604 break; 605 606 // Sticky in all forums 607 case 'super' : 608 bbp_stick_topic( $topic_id, true ); 609 break; 610 611 // Normal 612 case 'unstick' : 613 default : 614 bbp_unstick_topic( $topic_id ); 615 break; 616 } 617 } 616 618 617 619 /** Revisions *************************************************************/
Note: See TracChangeset
for help on using the changeset viewer.