Changeset 3449
- Timestamp:
- 11/19/2010 07:41:13 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-templatetags.php
r3369 r3449 124 124 $user_id = false; 125 125 $page = 1; 126 $search_terms = false;126 $search_terms = null; 127 127 128 128 // User filtering 129 129 if ( !empty( $bp->displayed_user->id ) ) 130 130 $user_id = $bp->displayed_user->id; 131 132 // Pass a filter if ?s= is set.133 if ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )134 $search_terms = $_REQUEST['s'];135 131 136 132 // type: active ( default ) | random | newest | popular | online | alphabetical … … 152 148 $r = wp_parse_args( $args, $defaults ); 153 149 extract( $r ); 150 151 // Pass a filter if ?s= is set. 152 if ( is_null( $search_terms ) ) { 153 if ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) ) 154 $search_terms = $_REQUEST['s']; 155 else 156 $search_terms = false; 157 } 154 158 155 159 if ( $max ) { -
trunk/bp-groups/bp-groups-templatetags.php
r3372 r3449 139 139 $type = 'active'; 140 140 $user_id = false; 141 $search_terms = false;141 $search_terms = null; 142 142 $slug = false; 143 143 … … 160 160 } 161 161 162 if ( isset( $_REQUEST['group-filter-box'] ) || isset( $_REQUEST['s'] ) )163 $search_terms = ( isset( $_REQUEST['group-filter-box'] ) ) ? $_REQUEST['group-filter-box'] : $_REQUEST['s'];164 165 162 $defaults = array( 166 163 'type' => $type, … … 180 177 $r = wp_parse_args( $args, $defaults ); 181 178 extract( $r ); 179 180 if ( is_null( $search_terms ) ) { 181 if ( isset( $_REQUEST['group-filter-box'] ) && !empty( $_REQUEST['group-filter-box'] ) ) 182 $search_terms = $_REQUEST['group-filter-box']; 183 elseif ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) ) 184 $search_terms = $_REQUEST['s']; 185 else 186 $search_terms = false; 187 } 182 188 183 189 $groups_template = new BP_Groups_Template( (int)$user_id, $type, (int)$page, (int)$per_page, (int)$max, $slug, $search_terms, $include, (bool)$populate_extras, $exclude ); … … 1812 1818 1813 1819 $search_value = __( 'Search anything...', 'buddypress' ); 1814 if ( !empty( $_REQUEST['s'] ) )1820 if ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) ) 1815 1821 $search_value = $_REQUEST['s']; 1816 1822
Note: See TracChangeset
for help on using the changeset viewer.