From 9ee598a15ffde8017a0e7e4a68dbe681b637aa35 Mon Sep 17 00:00:00 2001 From: LebCit Date: Mon, 15 Jul 2019 18:54:25 +0300 Subject: [PATCH] Corrected Undefined index 'fsmsp_search_form_text' --- class-full-screen-morphing-search.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/class-full-screen-morphing-search.php b/class-full-screen-morphing-search.php index dda661b..d60cf66 100644 --- a/class-full-screen-morphing-search.php +++ b/class-full-screen-morphing-search.php @@ -84,8 +84,12 @@ class Full_Screen_Morphing_Search { $fsmsp_options = get_option( 'fsmsp_options' ); // Associative Array 'fsmsp_options'. - // Setting the placeholder as a variable to output the option depending on the case. - $fsmsp_placeholder = $fsmsp_options['fsmsp_search_form_text']; // Selecting the key to get the value. + /** + * Setting the placeholder as a variable to output the option depending on the case. + * + * For "Notice: Undefined index" : @see https://stackoverflow.com/a/4261200 + */ + $fsmsp_placeholder = isset( $fsmsp_options['fsmsp_search_form_text'] ) ? $fsmsp_options['fsmsp_search_form_text'] : ''; // Selecting the key to get the value. if ( ! empty( $fsmsp_placeholder ) ) { $fsmsp_placeholder = esc_attr( $fsmsp_placeholder ); } else {