From e7254278c2b26ca87880eaeda3aaf48c0ceff1b2 Mon Sep 17 00:00:00 2001 From: Brian Fischer Date: Mon, 12 Apr 2021 17:32:06 -0400 Subject: [PATCH] fix(admin): Make sure $selected_styles is an array before running in_array, adding link to Global Design Settings page in the callout --- src/Controller/Admin/Courier_Notice_Metabox.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/Admin/Courier_Notice_Metabox.php b/src/Controller/Admin/Courier_Notice_Metabox.php index 9aeb4927..3a89cbe5 100644 --- a/src/Controller/Admin/Courier_Notice_Metabox.php +++ b/src/Controller/Admin/Courier_Notice_Metabox.php @@ -213,7 +213,7 @@ public function post_submitbox_misc_actions() { if ( ! in_array( $pagenow, array( 'post-new.php' ) ) ) { $courier_options = get_option( 'courier_design', array() ); - $selected_styles = $courier_options['enable_title']; + $selected_styles = ( is_array( $courier_options['enable_title'] ) ) ? $courier_options['enable_title'] : []; if ( has_term( '', 'courier_style' ) ) { $selected_courier_style = get_the_terms( $post->ID, 'courier_style' ); @@ -225,7 +225,7 @@ public function post_submitbox_misc_actions() { $show_hide = 'hide'; ?>
-

The Notice Style (name ); ?>) is displaying this Notice's Title by default in the global design settings. Use the "Hide title" toggle below to override for this notice.

+

The Notice Style (name ); ?>) is displaying this Notice's Title by default in the global design settings. Use the "Hide title" toggle below to override for this notice.