From f1a28048c364c99116f9fc34ecf1f60b8fba65ab Mon Sep 17 00:00:00 2001 From: Brian Hogg Date: Thu, 18 Jul 2024 11:58:23 -0400 Subject: [PATCH] Exclude hidden courses when toggled off in block (#2691) * Avoid showing hidden courses when toggled off in the Courses block. It's boolean false in this case but also adding explicit empty. * Adding changelog. --- ...2690-exclude-hidden-courses-when-toggled-off-in-block.yml | 5 +++++ includes/shortcodes/class.llms.shortcode.courses.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changelogs/fix_2690-exclude-hidden-courses-when-toggled-off-in-block.yml diff --git a/.changelogs/fix_2690-exclude-hidden-courses-when-toggled-off-in-block.yml b/.changelogs/fix_2690-exclude-hidden-courses-when-toggled-off-in-block.yml new file mode 100644 index 0000000000..dc0cea332e --- /dev/null +++ b/.changelogs/fix_2690-exclude-hidden-courses-when-toggled-off-in-block.yml @@ -0,0 +1,5 @@ +significance: patch +type: fixed +links: + - "#2690" +entry: Exclude hidden courses when toggled off in the Courses block. diff --git a/includes/shortcodes/class.llms.shortcode.courses.php b/includes/shortcodes/class.llms.shortcode.courses.php index 962db4a257..b9d66358ee 100644 --- a/includes/shortcodes/class.llms.shortcode.courses.php +++ b/includes/shortcodes/class.llms.shortcode.courses.php @@ -125,7 +125,7 @@ protected function get_tax_query() { } $hidden = $this->get_attribute( 'hidden' ); - if ( 'no' === $hidden ) { + if ( 'no' === $hidden || false === $hidden || '' === $hidden ) { $terms = wp_list_pluck( get_terms(