Changeset 6056 for trunk/src/includes/topics/functions.php
- Timestamp:
- 06/05/2016 06:27:54 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/topics/functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/functions.php
r6037 r6056 393 393 do_action( 'bbp_new_topic', $topic_id, $forum_id, $anonymous_data, $topic_author ); 394 394 395 /** Stickies **********************************************************/396 397 // Sticky check after 'bbp_new_topic' action so forum ID meta is set398 if ( ! empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) {399 400 // What's the caps?401 if ( current_user_can( 'moderate', $topic_id ) ) {402 403 // What's the haps?404 switch ( $_POST['bbp_stick_topic'] ) {405 406 // Sticky in this forum407 case 'stick' :408 bbp_stick_topic( $topic_id );409 break;410 411 // Super sticky in all forums412 case 'super' :413 bbp_stick_topic( $topic_id, true );414 break;415 416 // We can avoid this as it is a new topic417 case 'unstick' :418 default :419 break;420 }421 }422 }423 424 395 /** Additional Actions (After Save) ***********************************/ 425 396 … … 761 732 } 762 733 763 /** Stickies **********************************************************/764 765 // Get the topic types766 $topic_types = bbp_get_topic_types( $topic_id );767 768 // Maybe sticky769 if ( ! empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array_keys( $topic_types ) ) ) {770 771 // What's the caps?772 if ( current_user_can( 'moderate', $topic_id ) ) {773 774 // What's the haps?775 switch ( $_POST['bbp_stick_topic'] ) {776 777 // Sticky in forum778 case 'stick' :779 bbp_stick_topic( $topic_id );780 break;781 782 // Sticky in all forums783 case 'super' :784 bbp_stick_topic( $topic_id, true );785 break;786 787 // Normal788 case 'unstick' :789 default :790 bbp_unstick_topic( $topic_id );791 break;792 }793 }794 }795 796 734 /** Additional Actions (After Save) ***********************************/ 797 735 … … 879 817 if ( empty( $forum_id ) ) { 880 818 $forum_id = bbp_get_topic_forum_id( $topic_id ); 819 } 820 821 // Get the topic types 822 $topic_types = bbp_get_topic_types( $topic_id ); 823 824 // Sticky check after 'bbp_new_topic' action so forum ID meta is set 825 if ( ! empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array_keys( $topic_types ) ) ) { 826 827 // What's the caps? 828 if ( current_user_can( 'moderate', $topic_id ) ) { 829 830 // What's the haps? 831 switch ( $_POST['bbp_stick_topic'] ) { 832 833 // Sticky in this forum 834 case 'stick' : 835 bbp_stick_topic( $topic_id ); 836 break; 837 838 // Super sticky in all forums 839 case 'super' : 840 bbp_stick_topic( $topic_id, true ); 841 break; 842 843 // We can avoid this as it is a new topic 844 case 'unstick' : 845 default : 846 break; 847 } 848 } 881 849 } 882 850
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)