Adding region-search to event list shortcode.
$categoriesSorted = $this->sortParentChild($categories);
if (!$forEdit) {
- while (list($k, $v) = each($categoriesSorted)) {
+ foreach ( $categoriesSorted as $k => $v ) {
$categoriesSorted[$k]['parent_id'] = $v['parent']['value'];
$categoriesSorted[$k]['parent'] = $v['parent']['name'];
}
$_REQUEST[$locID.'_event'] = $this->eventID;
// Check for new cities in this location and if so use the new city real ID
- if (isset($_REQEUST[$locID.'_city']) && $_REQUEST[$locID.'_city'][0] == 'n') {
+ if (isset($_REQUEST[$locID.'_city']) && $_REQUEST[$locID.'_city'][0] == 'n') {
$_REQUEST[$locID.'_city'] = $newCityID[$_REQUEST[$locID.'_city']];
}
if (isset($_REQUEST['locID'])) {
// For each location
- while (list($id, $locID) = each($_REQUEST['locID'])) {
+ foreach ( $_REQUEST['locID'] $id => $locID ) {
// Check for new cities in this location and if so use the new city real ID
- if (isset($_REQEUST[$locID.'_city']) && $_REQUEST[$locID.'_city'][0] == 'n') {
+ if (isset($_REQUEST[$ocID.'_city']) && $_REQUEST[$locID.'_city'][0] == 'n') {
$_REQUEST[$locID.'_city'] = $newCityID[$_REQUEST[$locID.'_city']];
}
// Add "selected" element default false;
reset($categories);
- while (list($k, $v) = each($categories)) {
+ foreach ( $categories $k => $v ) {
$categories[$k]['selected'] = false;
}
$Cities = new GlmDataCities($this->wpdb, $this->config);
// For each new city submitted
- while (list($k, $v) = each($_REQUEST['newCity'])) {
+ foreach ( $_REQUEST['newCity'] as $k => $v ) {
$cName = trim(filter_var($_REQUEST['newCity'][$k]));
// Finally, move the files to the various size directories and rename them back to the correct name
reset($this->config['imageSizes']);
- while (list($k, $v) = each($this->config['imageSizes'])) {
+ foreach ( $this->config['imageSizes'] as $k => $v ) {
// Check if size directory needs to be made
if (!file_exists(GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$k)) {
}
// Check for numeric IDs only
- while (list($k, $v) = each($catsRequested)) {
+ foreach ( $catsRequested as $k => $v ) {
// If it's just numeric - note Explode returns an array element with value = 0 if no string.
if (preg_match('/^[0-9]*$/', trim($v)) && $v > 0) {
}
+
if ( isset( $_REQUEST['amenity'] ) && $amenityId = filter_var( $_REQUEST['amenity'], FILTER_VALIDATE_INT ) ) {
$search = true;
$action = 'event-list';
$search = true;
$action = 'event-list';
}
+ if ( isset( $actionData['request']['region-search'] ) && $regionId = filter_var( $actionData['request']['region-search'], FILTER_VALIDATE_INT ) ) {
+ $search = true;
+ $action = 'event-list';
+ }
if ( isset( $_REQUEST['venue'] ) && $venueId = filter_var( $_REQUEST['venue'], FILTER_VALIDATE_INT ) ) {
$search = true;
$action = 'event-list';
'action' => 'list',
'table' => false,
'attributes' => array(
- 'type' => 'all',
- 'order' => 'title',
- 'member' => false,
- 'template' => false,
- 'limit' => null,
- 'featured' => null,
- 'current' => null,
- 'category' => null,
- 'pageslug' => null,
- 'group_by_day' => true,
- 'group_month' => false,
+ 'type' => 'all',
+ 'order' => 'title',
+ 'member' => false,
+ 'template' => false,
+ 'limit' => null,
+ 'featured' => null,
+ 'current' => null,
+ 'category' => null,
+ 'region-search' => null,
+ 'pageslug' => null,
+ 'group_by_day' => true,
+ 'group_month' => false,
'show_all_in_agenda' => false,
)
),
to display may be overridden by the "category-search" parameter.
</td>
</tr>
+ <tr>
+ <td> </td>
+ <th>
+ region-search="{ region ID }"
+ </th>
+ <td>
+ The "region-search" attribute selects members who are listed in the specified
+ region. The region is specified by ID rather than name. This may be overridden by
+ a "region" URL parameter.
+ </td>
+ </tr>
<tr>
<td> </td>
<th>