Changeset 4809
- Timestamp:
- 03/15/2013 10:07:35 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/includes/extend/buddypress/group.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/extend/buddypress/group.php
r4791 r4809 3 3 /** 4 4 * bbPress BuddyPress Group Extension Class 5 * 6 * This file is responsible for connecting bbPress to BuddyPress's Groups 7 * Component. It's a great example of how to perform both simple and advanced 8 * techniques to manipulate bbPress's default output. 5 9 * 6 10 * @package bbPress … … 628 632 case 'page' : 629 633 634 // Strip the super stickies from topic query 635 add_filter( 'bbp_get_super_stickies', array( $this, 'no_super_stickies' ), 10, 1 ); 636 637 // Unset the super sticky option on topic form 638 add_filter( 'bbp_after_topic_type_select_parse_args', array( $this, 'unset_super_sticky' ), 10, 1 ); 639 630 640 // Query forums and show them if they exist 631 641 if ( bbp_forums() ) : … … 653 663 case $this->topic_slug : 654 664 665 // hide the 'to front' admin links 666 add_filter( 'bbp_get_topic_stick_link', array( $this, 'hide_super_sticky_admin_link' ), 10, 2 ); 667 655 668 // Get the topic 656 669 bbp_has_topics( array( 657 670 'name' => bp_action_variable( $offset + 1 ), 658 'posts_per_page' => 1 671 'posts_per_page' => 1, 672 'show_stickies' => false 659 673 ) ); 660 674 … … 676 690 // Topic edit 677 691 if ( bp_action_variable( $offset + 2 ) == bbp_get_edit_rewrite_id() ) : 692 693 // Unset the super sticky link on edit topic template 694 add_filter( 'bbp_after_topic_type_select_parse_args', array( $this, 'unset_super_sticky' ), 10, 1 ); 678 695 679 696 // Set the edit switches … … 763 780 // Allow actions immediately after group forum output 764 781 do_action( 'bbp_after_group_forum_display' ); 782 } 783 784 /** Super sticky filters ***************************************************/ 785 786 /** 787 * Strip super stickies from the topic query 788 * 789 * @since bbPress (r4810) 790 * @access private 791 * @param array $super the super sticky post ID's 792 * @return array (empty) 793 */ 794 public function no_super_stickies( $super = array() ) { 795 $super = array(); 796 return $super; 797 } 798 799 /** 800 * Unset the type super sticky from topic type 801 * 802 * @since bbPress (r4810) 803 * @access private 804 * @param array $args 805 * @return array $args without the to-front link 806 */ 807 public function unset_super_sticky( $args = array() ) { 808 unset( $args['super_text'] ); 809 return $args; 810 } 811 812 /** 813 * Ugly preg_replace to hide the to front admin link 814 * 815 * @since bbPress (r4810) 816 * @access private 817 * @param string $retval 818 * @param array $args 819 * @return string $retval without the to-front link 820 */ 821 public function hide_super_sticky_admin_link( $retval = '', $args = array() ) { 822 if ( strpos( $retval, '(' ) ) { 823 $retval = preg_replace( '/(\(.+?)+(\))/i', '', $retval ); 824 } 825 826 return $retval; 765 827 } 766 828
Note: See TracChangeset
for help on using the changeset viewer.