Changeset 6438 for trunk/src/includes/forums/functions.php
- Timestamp:
- 05/27/2017 05:04:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/functions.php
r6434 r6438 83 83 do_action( 'bbp_insert_forum', (int) $forum_id ); 84 84 85 // Return new forum ID85 // Return forum_id 86 86 return $forum_id; 87 87 } … … 1167 1167 $forum_topic_count = (int) ( $total_topic_count + $difference ); 1168 1168 1169 // Filter & return 1169 1170 return (int) apply_filters( 'bbp_bump_forum_topic_count', $forum_topic_count, $forum_id, $difference, $update_ancestors ); 1170 1171 } … … 1267 1268 update_post_meta( $forum_id, '_bbp_topic_count_hidden', $new_count ); 1268 1269 1270 // Filter & return 1269 1271 return (int) apply_filters( 'bbp_bump_forum_topic_count_hidden', $new_count, $forum_id, $difference ); 1270 1272 } … … 1385 1387 $forum_reply_count = (int) ( $total_reply_count + $difference ); 1386 1388 1389 // Filter & return 1387 1390 return (int) apply_filters( 'bbp_bump_forum_reply_count', $forum_reply_count, $forum_id, $difference, $update_ancestors ); 1388 1391 } … … 1554 1557 } 1555 1558 1559 // Filter & return 1556 1560 return (int) apply_filters( 'bbp_update_forum_last_topic_id', $topic_id, $forum_id ); 1557 1561 } … … 1619 1623 } 1620 1624 1625 // Filter & return 1621 1626 return (int) apply_filters( 'bbp_update_forum_last_reply_id', $reply_id, $forum_id ); 1622 1627 } … … 1686 1691 } 1687 1692 1693 // Filter & return 1688 1694 return (int) apply_filters( 'bbp_update_forum_last_active_id', $active_id, $forum_id ); 1689 1695 } … … 1717 1723 } 1718 1724 1725 // Filter & return 1719 1726 return apply_filters( 'bbp_update_forum_last_active', $new_time, $forum_id ); 1720 1727 } … … 1740 1747 update_post_meta( $forum_id, '_bbp_forum_subforum_count', $subforums ); 1741 1748 1749 // Filter & return 1742 1750 return (int) apply_filters( 'bbp_update_forum_subforum_count', $subforums, $forum_id ); 1743 1751 } … … 1784 1792 update_post_meta( $forum_id, '_bbp_total_topic_count', $total_topics ); 1785 1793 1794 // Filter & return 1786 1795 return (int) apply_filters( 'bbp_update_forum_topic_count', $total_topics, $forum_id ); 1787 1796 } … … 1849 1858 } 1850 1859 1860 // Filter & return 1851 1861 return (int) apply_filters( 'bbp_update_forum_topic_count_hidden', $topic_count, $forum_id ); 1852 1862 } … … 1913 1923 update_post_meta( $forum_id, '_bbp_total_reply_count', $total_replies ); 1914 1924 1925 // Filter & return 1915 1926 return (int) apply_filters( 'bbp_update_forum_reply_count', $total_replies, $forum_id ); 1916 1927 } … … 2001 2012 */ 2002 2013 function bbp_get_forum_statuses( $forum_id = 0 ) { 2003 return apply_filters( 'bbp_get_forum_statuses', array( 2014 2015 // Filter & return 2016 return (array) apply_filters( 'bbp_get_forum_statuses', array( 2004 2017 'open' => _x( 'Open', 'Open the forum', 'bbpress' ), 2005 2018 'closed' => _x( 'Closed', 'Close the forum', 'bbpress' ) … … 2017 2030 */ 2018 2031 function bbp_get_forum_types( $forum_id = 0 ) { 2019 return apply_filters( 'bbp_get_forum_types', array( 2032 2033 // Filter & return 2034 return (array) apply_filters( 'bbp_get_forum_types', array( 2020 2035 'forum' => _x( 'Forum', 'Forum accepts new topics', 'bbpress' ), 2021 2036 'category' => _x( 'Category', 'Forum is a category', 'bbpress' ) … … 2033 2048 */ 2034 2049 function bbp_get_forum_visibilities( $forum_id = 0) { 2035 return apply_filters( 'bbp_get_forum_visibilities', array( 2050 2051 // Filter & return 2052 return (array) apply_filters( 'bbp_get_forum_visibilities', array( 2036 2053 bbp_get_public_status_id() => _x( 'Public', 'Make forum public', 'bbpress' ), 2037 2054 bbp_get_private_status_id() => _x( 'Private', 'Make forum private', 'bbpress' ), … … 2060 2077 : array(); 2061 2078 2062 return apply_filters( 'bbp_get_hidden_forum_ids', (array) $forum_ids ); 2079 // Filter & return 2080 return (array) apply_filters( 'bbp_get_hidden_forum_ids', $forum_ids ); 2063 2081 } 2064 2082 … … 2081 2099 : array(); 2082 2100 2083 return apply_filters( 'bbp_get_private_forum_ids', (array) $forum_ids ); 2101 // Filter & return 2102 return (array) apply_filters( 'bbp_get_private_forum_ids', $forum_ids ); 2084 2103 } 2085 2104 … … 2177 2196 } 2178 2197 2179 // Filter and return the results2198 // Filter & return 2180 2199 return apply_filters( 'bbp_exclude_forum_ids', $retval, $forum_ids, $type ); 2181 2200 } … … 2306 2325 $topic_ids = bbp_get_public_child_ids( $forum_id, bbp_get_topic_post_type() ); 2307 2326 2327 // Filter & return 2308 2328 return (array) apply_filters( 'bbp_forum_query_topic_ids', $topic_ids, $forum_id ); 2309 2329 } … … 2325 2345 $subforum_ids = bbp_get_all_child_ids( $forum_id, bbp_get_forum_post_type() ); 2326 2346 2347 // Filter & return 2327 2348 return (array) apply_filters( 'bbp_forum_query_subforum_ids', $subforum_ids, $forum_id ); 2328 2349 } … … 2373 2394 unset( $query ); 2374 2395 2396 // Filter & return 2375 2397 return (int) apply_filters( 'bbp_forum_query_last_reply_id', $reply_id, $forum_id ); 2376 2398 }
Note: See TracChangeset
for help on using the changeset viewer.