Skip to content

Commit

Permalink
Don't pass null values to wp_editor or wp_kses_post (#77)
Browse files Browse the repository at this point in the history
Don't pass null values to wp_editor or wp_kses_post in order to resolve PHP 8.1 passing null value deprecation notice.
  • Loading branch information
thefrosty authored Oct 26, 2023
1 parent 0bc746e commit 8d979b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Settings/FieldTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public function wysiwyg(array $args): void
$editor_settings = array_merge($editor_settings, $field->getOptions());

\ob_start();
\wp_editor($value, $field->getSectionId() . '-' . $field->getId(), $editor_settings);
\wp_editor($value ?? '', $field->getSectionId() . '-' . $field->getId(), $editor_settings);

$output .= \ob_get_clean();
$output .= '</div>';
Expand Down Expand Up @@ -528,7 +528,7 @@ public function html(array $args): void
$value = Options::getOption($field->getId(), $field->getSectionId(), $field->getDefault());

$output = '<div class="FieldType_html">';
$output .= \wp_kses_post($value);
$output .= \wp_kses_post($value ?? '');
$output .= '</div>';
$output .= $this->getFieldDescription($args);

Expand Down

0 comments on commit 8d979b5

Please sign in to comment.