Skip to content

Commit

Permalink
fix: Some null handling that is deprecated in newer versions of PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimple committed Apr 9, 2024
1 parent a7da3af commit d89c27d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion PLUGIN-CHECKSUM
@@ -1 +1 @@
a8eda52c319500fecae0731cee509ae8
19e1da41df793f66c4cb9a74dcbb9581
10 changes: 6 additions & 4 deletions content/template/listTemplate/blocks/course-block-a.php
Expand Up @@ -24,10 +24,12 @@
}

if ( $show_descr ) {
echo '<div class="courseDescription">' . wp_kses( $descr, array(
'br' => array(),
'p' => array(),
) ) . '</div>';
if ( $descr != null ) {
echo '<div class="courseDescription">' . wp_kses( $descr, array(
'br' => array(),
'p' => array(),
) ) . '</div>';
}
}

if ( $show_course_locations && ! empty( $event_cities ) && $show_city ) {
Expand Down
16 changes: 11 additions & 5 deletions content/template/listTemplate/blocks/course-block-b.php
Expand Up @@ -18,14 +18,20 @@
}
}
} else {
$descr = strip_tags( $object[ $descr_field ] );
if ( $object[ $descr_field ] != null ) {
$descr = strip_tags( $object[ $descr_field ] );
} else {
$descr = null;
}
}

if ( $show_descr ) {
echo '<div class"courseDescription">' . wp_kses( $descr, array(
'br' => array(),
'p' => array(),
) ) . '</div>';
if ( $descr != null ) {
echo '<div class"courseDescription">' . wp_kses( $descr, array(
'br' => array(),
'p' => array(),
) ) . '</div>';
}
}

if ( $show_course_locations && ! empty( $event_cities ) && $show_city ) {
Expand Down

0 comments on commit d89c27d

Please sign in to comment.