Ticket #2227: 2227.diff
| File 2227.diff, 3.2 KB (added by , 13 years ago) |
|---|
-
includes/topics/template-tags.php
2893 2893 $sticky_statuses = array ( 2894 2894 'unstick' => $r['unstick_text'], 2895 2895 'stick' => $r['stick_text'], 2896 'super' => $r['super_text'], 2897 ); ?> 2896 ); 2897 if( !empty( $r['super_text'] ) ) 2898 $sticky_statuses['super'] = $r['super_text']; ?> 2898 2899 2899 2900 <select name="<?php echo $select_id; ?>" id="<?php echo $select_id; ?>"<?php echo $tab; ?>> 2900 2901 -
includes/extend/buddypress/group.php
626 626 627 627 case false : 628 628 case 'page' : 629 630 // strip the super stickies from topic query 631 add_filter( 'bbp_get_super_stickies', array( $this, 'strip_super_stickies_from_topic_query' ), 10, 1 ); 632 633 // unset the choice super sticky on topic form 634 add_filter( 'bbp_after_topic_type_select_parse_args', array( $this, 'unset_super_sticky' ), 10, 1 ); 629 635 630 636 // Query forums and show them if they exist 631 637 if ( bbp_forums() ) : … … 651 657 /** Single Topic **********************************************/ 652 658 653 659 case $this->topic_slug : 660 661 // hide the 'to front' admin links 662 add_filter( 'bbp_get_topic_stick_link', array( $this, 'hide_super_sticky_admin_link' ), 10, 2 ); 654 663 655 664 // Get the topic 656 665 bbp_has_topics( array( 657 666 'name' => bp_action_variable( $offset + 1 ), 658 'posts_per_page' => 1 667 'posts_per_page' => 1, 668 'show_stickies' => false 659 669 ) ); 660 670 661 671 // If no topic, 404 … … 675 685 676 686 // Topic edit 677 687 if ( bp_action_variable( $offset + 2 ) == bbp_get_edit_rewrite_id() ) : 688 689 // unset the choice super sticky on edit topic template 690 add_filter( 'bbp_after_topic_type_select_parse_args', array( $this, 'unset_super_sticky' ), 10, 1 ); 678 691 679 692 // Set the edit switches 680 693 $wp_query->bbp_is_edit = true; … … 763 776 // Allow actions immediately after group forum output 764 777 do_action( 'bbp_after_group_forum_display' ); 765 778 } 779 780 /** Super sticky filters ***************************************************/ 781 782 /** 783 * Strip super stickies from the topic query 784 * 785 * @param array $super the super stickies 786 * @return array (empty) 787 */ 788 public function strip_super_stickies_from_topic_query( $super ) { 789 return array(); 790 } 791 792 /** 793 * Unset the type super sticky from topic type 794 * 795 * @param array $args 796 * @return array $args ( - the super sticky choice ) 797 */ 798 public function unset_super_sticky( $args ) { 799 unset( $args['super_text'] ); 800 return $args; 801 } 802 803 /** 804 * Ugly preg_replace to hide the to front admin link 805 * 806 * @param str $retval 807 * @param array $args 808 * @return str $retval ( - the to front link ) 809 */ 810 public function hide_super_sticky_admin_link( $retval, $args ) { 811 if( strpos( $retval, '(' ) ) 812 $retval = preg_replace( '/(\(.+?)+(\))/i', '', $retval ); 813 814 return $retval; 815 } 766 816 767 817 /** Redirect Helpers ******************************************************/ 768 818