Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions admin/partials/_meetings_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ function Bread_meetings_setup_page_render(Bread_AdminDisplay $breadAdmin)
<option <?php echo ($bread->getOption('main_grouping') == 'location_sub_province' ? 'selected' : '') ?> value="location_sub_province"><?php esc_html_e('County', 'bread') ?></option>
<option <?php echo ($bread->getOption('main_grouping') == 'location_city_subsection' ? 'selected' : '') ?> value="location_city_subsection"><?php esc_html_e('Borough', 'bread') ?></option>
<option <?php echo ($bread->getOption('main_grouping') == 'location_province' ? 'selected' : '') ?> value="location_province"><?php esc_html_e('State', 'bread') ?></option>
<?php
$fks = $bread->bmlt()->get_nonstandard_fieldkeys();
foreach ($fks as $fk) {
$selected = '';
if ($fk['key'] == $bread->getOption('main_grouping')) {
$selected = 'selected';
}
echo '<option value="' . esc_attr($fk['key']) . '" ' . esc_attr($selected) . '>' . esc_html($fk['description']) . '</option>';
}
?>
</select>
<label for="subgrouping"><?php esc_html_e('Sub-Grouping: ', 'bread') ?></label>
<select id="subgrouping" name="subgrouping">
Expand Down
2 changes: 1 addition & 1 deletion bmlt-meeting-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Bread
* Plugin URI: https://bmlt.app
* Description: Maintains and generates PDF Meeting Lists from BMLT.
* Version: 2.10.6
* Version: 2.10.7
* Author: bmlt-enabled
* Author URI: https://bmlt.app/
* License: GPL-2.0+
Expand Down
19 changes: 14 additions & 5 deletions includes/class-bread-bmlt.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ class Bread_Bmlt
private Bread $bread;
private ?array $preloaded = null;

function __construct($bread)
function __construct(Bread $bread)
{
$this->bread = $bread;
}
public function preload($results)
public function preload(array|null $results)
{
$this->preloaded = $results;
}
private function get_configured_root_server_request($url, $raw = false)
private function get_configured_root_server_request(string $url, bool $raw = false): WP_Error | array
{
$results = $this->get($this->bread->getOption('root_server') . "/$url");
if ($raw) {
Expand Down Expand Up @@ -134,7 +134,7 @@ public function doExtraMeetingQuery()
}
return $this->get_configured_root_server_request($this->generateExtraMeetingQuery());
}
public function generateAdditionalListQuery($json = 'json')
public function generateAdditionalListQuery($json = 'json'): ?string
{
if (!empty($this->options['additional_list_custom_query'])) {
$sort_order = $this->bread->getOption('additional_list_sort_order');
Expand Down Expand Up @@ -198,6 +198,15 @@ public function testRootServer(string $override_root_server = null): array|bool

return json_decode(wp_remote_retrieve_body($results), true);
}
public function get_nonstandard_fieldkeys(): array
{
$ret = array();
$ext_fields = apply_filters("Bread_Enrich_Meeting_Data", array(), array());
foreach ($ext_fields as $key => $value) {
$ret[] = array("key" => $key, "description" => $key);
}
return $ret;
}
/**
* Convenient front end to array_multisort. Sorts the array in place.
*
Expand Down Expand Up @@ -238,7 +247,7 @@ public function generateDefaultQuery(): string
}
return $this->default_query;
}
public function parse_field($text)
public function parse_field(string $text): string
{
if ($text != '') {
$exploded = explode("#@-@#", $text);
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Contributors: odathp, radius314, pjaudiomv, klgrimley, jbraswell, otrok7, alanb2
Tags: meeting list, bmlt, narcotics anonymous, na
Requires PHP: 8.1
Requires at least: 6.2
Tested up to: 7.0
Stable tag: 2.10.6
Tested up to: 7.1
Stable tag: 2.10.7

License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -55,6 +55,9 @@ Follow all these steps, keep in mind that once you start using bread, it's not g

== Changelog ==

= 2.10.7 =
* Allow fields added through extenstions to be used as groupings

= 2.10.6 =
* Cleaned up some warnings.

Expand Down
Loading