// Get cities for possible use in search pick list for cities used in active member info records.
require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCities.php';
- $cities = new GlmDataCities($this->wpdb, $this->config);
+ $cities = new GlmDataCities($this->wpdb, $this->config);
$cityData = $cities->getListForSearch( true, $actionData ); // Get only categories that are used in active member data
+ // If we have members set in shortcode
+ $members = array();
+ if ( isset( $actionData['request']['members'] ) && $actionData['request']['members'] ) {
+ // Convert to array of member id's
+ $membersRequested = explode( ',', $actionData['request']['members'] );
+
+ // Check for numeric ID's only
+ foreach ( $membersRequested as $member ) {
+ if ( $member_id = filter_var( $member, FILTER_VALIDATE_INT ) ) {
+ $members[] = $member_id;
+ }
+ }
+
+ // If not empty add to the $where
+ if ( !empty( $members ) ) {
+ $where .= $whereSep . " T.member IN (" . implode( ',', $members ) . ")";
+ $whereSep = ' AND ';
+ }
+ }
+
// If we have a region set in shortcode or via URL.
$regions = array();
- if ( isset( $actionData['request']['region-search'] ) && $actionData['request']['region-search']) {
+ if ( isset( $actionData['request']['region-search'] ) && $actionData['request']['region-search'] ) {
// Convert comma separated list to an array
$regionsRequested = explode( ',', $actionData['request']['region-search'] );
'cacheTime' => '2 WEEK' // MySQL "DATE_ADD" time interval - see https://www.w3schools.com/sql/func_date_add.asp
),
'attributes' => array(
+ 'members' => false,
'type' => false,
'category' => false,
'category-name' => false,
the attributes below may used to modify the display of this page.
</td>
</tr>
+ <tr>
+ <td> </td>
+ <th>
+ members="{ member ID(s) }"
+ </th>
+ <td>
+ The "members" attribute is used to set the default display of members
+ to only one or more members by specifying the IDs.
+ To select multiple types, separate the IDs with a ",".
+ The ID for each member is shown in the "Members" list in the
+ admin "Settings" menu.
+ </td>
+ </tr>
<tr>
<td> </td>
<th>
</th>
<td>
The "type" attribute is used to set the default display of members
- to only one or more member types by specifying the category IDs.
+ to only one or more member types by specifying the Type IDs.
To select multiple types, separate the IDs with a ",".
The ID for each member type is shown in the "Member Types" list in the
admin "Settings" menu.