Corrected Undefined index 'fsmsp_search_form_text'

This commit is contained in:
LebCit
2019-07-15 18:54:25 +03:00
parent 945241dff7
commit 9ee598a15f
+6 -2
View File
@@ -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 {