diff --git a/.changelogs/3199.yml b/.changelogs/3199.yml new file mode 100644 index 0000000000..99aa993961 --- /dev/null +++ b/.changelogs/3199.yml @@ -0,0 +1,3 @@ +significance: patch +type: changed +entry: "Replaced deprecated `get_terms()` two-argument string form (e.g. `'hide_empty=0'`, removed in WP 4.5.0) with the modern single-argument array form in the course options meta box. Adjusted the `traverse_and_serialize_blocks()` reference to be conditional on WordPress 6.4.0+ via a `phpcs:ignore` annotation while preserving the existing `function_exists()` fallback to `_inject_theme_attribute_in_block_template_content()` for older WordPress versions." diff --git a/includes/admin/post-types/meta-boxes/class.llms.meta.box.course.options.php b/includes/admin/post-types/meta-boxes/class.llms.meta.box.course.options.php index 5b537ef8db..8960908353 100644 --- a/includes/admin/post-types/meta-boxes/class.llms.meta.box.course.options.php +++ b/includes/admin/post-types/meta-boxes/class.llms.meta.box.course.options.php @@ -53,7 +53,7 @@ public function get_fields() { $course = new LLMS_Course( $this->post ); - $course_tracks_options = get_terms( 'course_track', 'hide_empty=0' ); + $course_tracks_options = get_terms( array( 'taxonomy' => 'course_track', 'hide_empty' => false ) ); $course_tracks = array(); foreach ( (array) $course_tracks_options as $term ) { $course_tracks[] = array( @@ -63,7 +63,7 @@ public function get_fields() { } // Setup course difficulty select options. - $difficulty_terms = get_terms( 'course_difficulty', 'hide_empty=0' ); + $difficulty_terms = get_terms( array( 'taxonomy' => 'course_difficulty', 'hide_empty' => false ) ); $difficulty_options = array(); foreach ( $difficulty_terms as $term ) { $difficulty_options[] = array( diff --git a/includes/class-llms-block-templates.php b/includes/class-llms-block-templates.php index 4e595fa6ef..82c6301aa4 100644 --- a/includes/class-llms-block-templates.php +++ b/includes/class-llms-block-templates.php @@ -373,6 +373,7 @@ private function build_template_result_from_file( $template_file, $template_slug $template = new WP_Block_Template(); $template->id = $theme ? $theme . '//' . $template_slug : $namespace . '//' . $template_slug; $template->theme = $theme ? $theme : $namespace; + // phpcs:ignore WordPress.WP.RequiresWP -- Fallback to deprecated _inject_theme_attribute_in_block_template_content() handled below for WP < 6.4.0. $template->content = function_exists( 'traverse_and_serialize_blocks' ) ? traverse_and_serialize_blocks( parse_blocks( $template_content ), '_inject_theme_attribute_in_template_part_block' ) : _inject_theme_attribute_in_block_template_content( $template_content );