Skip to content
Closed
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
3 changes: 3 additions & 0 deletions .changelogs/3199.yml
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
1 change: 1 addition & 0 deletions includes/class-llms-block-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
Loading