From c17c2dbcd35d96ff76f4b3b1317770e1f7ccde12 Mon Sep 17 00:00:00 2001 From: Boone B Gorges Date: Tue, 19 Sep 2023 15:59:26 +0000 Subject: [PATCH] In cbox-polyfill for get_site_template_id(), ensure that saved options are returned as integers. Otherwise strict comparisons will fail later. In this case, it was causing an extra instance of the fallback site ID to be appended to the Site Templates > Group Type Templates panel in some cases. See #3227. --- .../themes/openlab/lib/cbox-polyfills/class-cbox-group-type.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wp-content/themes/openlab/lib/cbox-polyfills/class-cbox-group-type.php b/wp-content/themes/openlab/lib/cbox-polyfills/class-cbox-group-type.php index de4c243a2d..02f30dc7c4 100644 --- a/wp-content/themes/openlab/lib/cbox-polyfills/class-cbox-group-type.php +++ b/wp-content/themes/openlab/lib/cbox-polyfills/class-cbox-group-type.php @@ -30,6 +30,7 @@ public function get_label() { */ public function get_site_template_id() { $site_template_ids = get_option( 'openlab_group_type_default_site_template_ids' ); + $site_template_ids = array_map( 'intval', $site_template_ids ); $saved_site_template_is_valid = false;