From 1ae8c0c891c5c648c2a2121595262dcf73f53364 Mon Sep 17 00:00:00 2001 From: Jorge Torres Date: Tue, 19 Mar 2024 23:53:32 +0000 Subject: [PATCH 1/3] Prevent possible type error during `WC_Install::create_options() --- .../includes/admin/settings/class-wc-settings-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php index 807d94310453..03f51a800ab1 100644 --- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php +++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php @@ -163,7 +163,7 @@ protected function get_settings_for_section_core( $section_id ) { */ public function get_sections() { $sections = $this->get_own_sections(); - return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections ); + return (array) apply_filters( 'woocommerce_get_sections_' . $this->id, $sections ); } /** From c07d86b2019ca19d3f7a62771b4ac96deaa65d39 Mon Sep 17 00:00:00 2001 From: Jorge Torres Date: Tue, 19 Mar 2024 23:53:35 +0000 Subject: [PATCH 2/3] Add changelog --- plugins/woocommerce/changelog/fix-type-error-create-options | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/woocommerce/changelog/fix-type-error-create-options diff --git a/plugins/woocommerce/changelog/fix-type-error-create-options b/plugins/woocommerce/changelog/fix-type-error-create-options new file mode 100644 index 000000000000..c0f7ef21ce54 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-type-error-create-options @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Prevent possible type error during install routine. From 572ee39694b6ee0f98be3f93627b91e490c9b555 Mon Sep 17 00:00:00 2001 From: Leif Singer Date: Wed, 20 Mar 2024 11:34:06 +0100 Subject: [PATCH 3/3] document the `woocommerce_get_sections_' . $this->id` filter --- .../includes/admin/settings/class-wc-settings-page.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php index 03f51a800ab1..7af5777779c8 100644 --- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php +++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php @@ -163,6 +163,12 @@ protected function get_settings_for_section_core( $section_id ) { */ public function get_sections() { $sections = $this->get_own_sections(); + /** + * Filters the sections for this settings page. + * + * @since 2.2.0 + * @param array $sections The sections for this settings page. + */ return (array) apply_filters( 'woocommerce_get_sections_' . $this->id, $sections ); }