Changeset 7379 for trunk/src/includes/extend/buddypress/groups.php
- Timestamp:
- 11/24/2025 07:23:06 PM (6 months ago)
- File:
-
- 1 edited
-
trunk/src/includes/extend/buddypress/groups.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/extend/buddypress/groups.php
r7378 r7379 1732 1732 * @since 2.6.14 1733 1733 * 1734 * @param object object Verifiedobject1735 * @param string $type Type of variable to c heck with `is_a()`1736 * @return mixed $objectVerified object if valid, Default or null if invalid1737 */ 1738 public function rewrite_pagination( $ object, $type = '' ) {1734 * @param object $query Verified query object 1735 * @param string $type Type of variable to compare to 1736 * @return mixed Verified object if valid, Default or null if invalid 1737 */ 1738 public function rewrite_pagination( $query, $type = '' ) { 1739 1739 1740 1740 // Bail if wrong global 1741 1741 if ( 'wp_query' !== $type ) { 1742 return $ object;1742 return $query; 1743 1743 } 1744 1744 1745 1745 // Bail if not inside a BuddyPress Group 1746 1746 if ( ! bp_is_group() ) { 1747 return $ object;1747 return $query; 1748 1748 } 1749 1749 1750 1750 // Bail if not inside a BuddyPress Group Forum 1751 1751 if ( ! bp_is_current_action( 'forum' ) ) { 1752 return $ object;1752 return $query; 1753 1753 } 1754 1754 … … 1767 1767 } 1768 1768 1769 // Single Forum 1770 } else { 1771 1772 // Get the page number from 1st position 1773 if ( bp_is_action_variable( 'page', 0 ) ) { 1774 $page_number = bp_action_variable( 1 ); 1775 } 1769 // Default (Single Forum) 1770 } elseif ( bp_is_action_variable( 'page', 0 ) ) { 1771 $page_number = bp_action_variable( 1 ); 1776 1772 } 1777 1773 1778 1774 // Bail if no page number 1779 1775 if ( empty( $page_number ) ) { 1780 return $ object;1776 return $query; 1781 1777 } 1782 1778 1783 1779 // Set the 'paged' WP_Query var to the new action-based value 1784 $ object->set( 'paged', $page_number );1780 $query->set( 'paged', $page_number ); 1785 1781 1786 1782 // Return the filtered/modified object 1787 return $ object;1783 return $query; 1788 1784 } 1789 1785
Note: See TracChangeset
for help on using the changeset viewer.