Skip to content

Commit 86f5689

Browse files
authored
make sure we have array keys first (#823)
1 parent b5a4e92 commit 86f5689

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

includes/helper-functions.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,10 @@ function constant_contact_get_widgets_by_form( $form_id ) {
633633
get_option( "widget_{$widget_type}", [] ),
634634
function( $value ) use ( $data ) {
635635
if ( 'ctct_form' === $data['type'] ) {
636-
return absint( $value['ctct_form_id'] ) === $data['form_id'];
636+
// We get this primarily from classic widgets as opposed to widget blocks.
637+
if ( is_array( $value ) && array_key_exists( 'ctct_form_id', $value ) ) {
638+
return absint( $value['ctct_form_id'] ) === $data['form_id'];
639+
}
637640
} elseif ( 'text' === $data['type'] ) {
638641
if ( ! isset( $value['text'] ) || false === strpos( $value['text'], '[ctct' ) ) {
639642
return false;

0 commit comments

Comments
 (0)