Skip to content

Commit d89c27d

Browse files
author
Chris Gårdenberg
committed
fix: Some null handling that is deprecated in newer versions of PHP
1 parent a7da3af commit d89c27d

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

PLUGIN-CHECKSUM

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a8eda52c319500fecae0731cee509ae8
1+
19e1da41df793f66c4cb9a74dcbb9581

content/template/listTemplate/blocks/course-block-a.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424
}
2525

2626
if ( $show_descr ) {
27-
echo '<div class="courseDescription">' . wp_kses( $descr, array(
28-
'br' => array(),
29-
'p' => array(),
30-
) ) . '</div>';
27+
if ( $descr != null ) {
28+
echo '<div class="courseDescription">' . wp_kses( $descr, array(
29+
'br' => array(),
30+
'p' => array(),
31+
) ) . '</div>';
32+
}
3133
}
3234

3335
if ( $show_course_locations && ! empty( $event_cities ) && $show_city ) {

content/template/listTemplate/blocks/course-block-b.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@
1818
}
1919
}
2020
} else {
21-
$descr = strip_tags( $object[ $descr_field ] );
21+
if ( $object[ $descr_field ] != null ) {
22+
$descr = strip_tags( $object[ $descr_field ] );
23+
} else {
24+
$descr = null;
25+
}
2226
}
2327

2428
if ( $show_descr ) {
25-
echo '<div class"courseDescription">' . wp_kses( $descr, array(
26-
'br' => array(),
27-
'p' => array(),
28-
) ) . '</div>';
29+
if ( $descr != null ) {
30+
echo '<div class"courseDescription">' . wp_kses( $descr, array(
31+
'br' => array(),
32+
'p' => array(),
33+
) ) . '</div>';
34+
}
2935
}
3036

3137
if ( $show_course_locations && ! empty( $event_cities ) && $show_city ) {

0 commit comments

Comments
 (0)