Changeset 13493 for trunk/src/bp-groups/bp-groups-template.php
- Timestamp:
- 05/30/2023 05:56:44 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-template.php
r13490 r13493 2078 2078 2079 2079 /** 2080 * Output the permalink of a group's Members page.2081 *2082 * @since 1.0.02083 * @since 10.0.0 Added the `$group` parameter.2084 *2085 * @todo Deprecate: this function is not used inside the codebase.2086 *2087 * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object.2088 * Default: false.2089 */2090 function bp_group_all_members_permalink( $group = false ) {2091 echo esc_url( bp_get_group_all_members_permalink( $group ) );2092 }2093 /**2094 * Return the permalink of the Members page of a group.2095 *2096 * @since 1.0.02097 * @since 10.0.0 Updated to use `bp_get_group`.2098 *2099 * @todo Deprecate: this function is not used inside the codebase.2100 *2101 * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object.2102 * Default: false.2103 * @return string2104 */2105 function bp_get_group_all_members_permalink( $group = false ) {2106 $path_chunks = bp_groups_get_path_chunks( array( 'members' ) );2107 $url = bp_get_group_url( $group, $path_chunks );2108 2109 /**2110 * Filters the permalink of the Members page for a group.2111 *2112 * @since 1.0.02113 * @since 2.5.0 Added the `$group` parameter.2114 *2115 * @param string $url Permalink of the Members page for a group.2116 * @param BP_Groups_Group $group The group object.2117 */2118 return apply_filters( 'bp_get_group_all_members_permalink', $url, $group );2119 }2120 2121 /**2122 * Display a Groups search form.2123 *2124 * No longer used in BuddyPress.2125 *2126 * @todo Deprecate.2127 */2128 function bp_group_search_form() {2129 $label = __('Filter Groups', 'buddypress');2130 $name = 'group-filter-box';2131 $groups_slug = bp_get_groups_slug();2132 $action = bp_displayed_user_url(2133 array(2134 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ),2135 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_my_groups', 'my-groups' ),2136 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_search', 'search' ) ),2137 )2138 );2139 2140 $search_form_html = '<form action="' . esc_url( $action ) . '" id="group-search-form" method="post">2141 <label for="'. $name .'" id="'. $name .'-label">'. esc_html( $label ) .'</label>2142 <input type="search" name="'. $name . '" id="'. $name .'" value=""/>2143 2144 '. wp_nonce_field( 'group-filter-box', '_wpnonce_group_filter', true, false ) .'2145 </form>';2146 2147 echo apply_filters( 'bp_group_search_form', $search_form_html );2148 }2149 2150 /**2151 * Determine whether the displayed user has no groups.2152 *2153 * No longer used in BuddyPress.2154 *2155 * @todo Deprecate.2156 *2157 * @return bool True if the displayed user has no groups, otherwise false.2158 */2159 function bp_group_show_no_groups_message() {2160 if ( !groups_total_groups_for_user( bp_displayed_user_id() ) ) {2161 return true;2162 }2163 2164 return false;2165 }2166 2167 /**2168 * Determine whether the current page is a group activity permalink.2169 *2170 * No longer used in BuddyPress.2171 *2172 * @todo Deprecate.2173 *2174 * @return bool True if this is a group activity permalink, otherwise false.2175 */2176 function bp_group_is_activity_permalink() {2177 2178 if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( bp_get_activity_slug() ) ) {2179 return false;2180 }2181 2182 return true;2183 }2184 2185 /**2186 2080 * Output the pagination HTML for a group loop. 2187 2081 * … … 5495 5389 5496 5390 /** 5497 * Displays group filter titles.5498 *5499 * @since 1.0.05500 *5501 * @todo Deprecate?5502 */5503 function bp_groups_filter_title() {5504 $current_filter = bp_action_variable( 0 );5505 5506 switch ( $current_filter ) {5507 case 'recently-active': default:5508 _e( 'Recently Active', 'buddypress' );5509 break;5510 case 'recently-joined':5511 _e( 'Recently Joined', 'buddypress' );5512 break;5513 case 'most-popular':5514 _e( 'Most Popular', 'buddypress' );5515 break;5516 case 'admin-of':5517 _e( 'Administrator Of', 'buddypress' );5518 break;5519 case 'mod-of':5520 _e( 'Moderator Of', 'buddypress' );5521 break;5522 case 'alphabetically':5523 _e( 'Alphabetically', 'buddypress' );5524 break;5525 }5526 do_action( 'bp_groups_filter_title' );5527 }5528 5529 /**5530 5391 * Echo the current group type message. 5531 5392 *
Note: See TracChangeset
for help on using the changeset viewer.