Changeset 11145 for trunk/src/bp-groups/bp-groups-template.php
- Timestamp:
- 09/21/2016 10:53:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-template.php
r11129 r11145 70 70 */ 71 71 return apply_filters( 'bp_get_groups_root_slug', buddypress()->groups->root_slug ); 72 } 73 74 /** 75 * Output the group type base slug. 76 * 77 * @since 2.7.0 78 */ 79 function bp_groups_group_type_base() { 80 echo esc_url( bp_get_groups_group_type_base() ); 81 } 82 /** 83 * Get the group type base slug. 84 * 85 * The base slug is the string used as the base prefix when generating group 86 * type directory URLs. For example, in example.com/groups/type/foo/, 'foo' is 87 * the group type and 'type' is the base slug. 88 * 89 * @since 2.7.0 90 * 91 * @return string 92 */ 93 function bp_get_groups_group_type_base() { 94 /** 95 * Filters the group type URL base. 96 * 97 * @since 2.7.0 98 * 99 * @param string $base 100 */ 101 return apply_filters( 'bp_groups_group_type_base', _x( 'type', 'group type URL base', 'buddypress' ) ); 72 102 } 73 103 … … 174 204 } 175 205 206 $group_type = bp_get_current_group_directory_type(); 207 if ( ! $group_type && ! empty( $_GET['group_type'] ) ) { 208 if ( is_array( $_GET['group_type'] ) ) { 209 $group_type = $_GET['group_type']; 210 } else { 211 // Can be a comma-separated list. 212 $group_type = explode( ',', $_GET['group_type'] ); 213 } 214 } 215 176 216 // Default search string (too soon to escape here). 177 217 $search_query_arg = bp_core_get_component_search_query_arg( 'groups' ); … … 197 237 'slug' => $slug, 198 238 'search_terms' => $search_terms, 199 'group_type' => '',239 'group_type' => $group_type, 200 240 'group_type__in' => '', 201 241 'group_type__not_in' => '', … … 5080 5120 5081 5121 /** 5122 * Echo the current group type message. 5123 * 5124 * @since 2.7.0 5125 */ 5126 function bp_current_group_directory_type_message() { 5127 echo bp_get_current_group_directory_type_message(); 5128 } 5129 /** 5130 * Generate the current group type message. 5131 * 5132 * @since 2.7.0 5133 * 5134 * @return string 5135 */ 5136 function bp_get_current_group_directory_type_message() { 5137 $type_object = bp_groups_get_group_type_object( bp_get_current_group_directory_type() ); 5138 5139 $message = sprintf( __( 'Viewing groups of the type: %s', 'buddypress' ), '<strong>' . $type_object->labels['singular_name'] . '</strong>' ); 5140 5141 /** 5142 * Filters the current group type message. 5143 * 5144 * @since 2.7.0 5145 * 5146 * @param string $message Message to filter. 5147 */ 5148 return apply_filters( 'bp_get_current_group_type_message', $message ); 5149 } 5150 5151 /** 5082 5152 * Is the current page a specific group admin screen? 5083 5153 *
Note: See TracChangeset
for help on using the changeset viewer.