Prevent possible type error during `WC_Install::create_options()` (#45730)

* Prevent possible type error during `WC_Install::create_options()

* Add changelog

* document the `woocommerce_get_sections_' . $this->id` filter

---------

Co-authored-by: Leif Singer <git@singer.sh>
This commit is contained in:
Jorge A. Torres 2024-03-20 10:12:37 -03:00 committed by GitHub
parent 3ef4fc88a5
commit 4ce5bb55b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Prevent possible type error during install routine.

View File

@ -163,7 +163,13 @@ if ( ! class_exists( 'WC_Settings_Page', false ) ) :
*/
public function get_sections() {
$sections = $this->get_own_sections();
return apply_filters( 'woocommerce_get_sections_' . $this->id, $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 );
}
/**