Skip to content

Commit a3b2c43

Browse files
authored
SIG: Prevent PHP warning when setting key doesn't exist (#48873)
1 parent 2a848e2 commit a3b2c43

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
SIG: Prevent PHP warning when setting key doesn't exist.

projects/packages/publicize/src/social-image-generator/class-setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function generate_token_on_save( $post_id, $post, $update ) {
9494
if (
9595
! $update &&
9696
'auto-draft' === $post->post_status &&
97-
$settings->get_settings()['socialImageGeneratorSettings']['enabled'] &&
97+
! empty( $settings->get_settings()['socialImageGeneratorSettings']['enabled'] ) &&
9898
empty( $post_settings->get_settings( true ) ) &&
9999
'jetpack-social-note' !== $post->post_type
100100
) {

0 commit comments

Comments
 (0)