Corrected Undefined Index Error.

This commit is contained in:
LebCit
2018-12-10 03:34:49 +02:00
parent cb08010ec1
commit eccae43160
2 changed files with 9 additions and 10 deletions
+6 -7
View File
@@ -81,11 +81,12 @@ class Full_Screen_Morphing_Search {
* @since 1.1
*/
public function full_screen_morphing_search_output_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_options = get_option( 'fsmsp_options' ); // Associative Array 'fsmsp_options'.
$fsmsp_placeholder = $fsmsp_options['fsmsp_search_form_text']; // Selecting the key to get the value.
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- strict comparison not working !
if ( '' != $fsmsp_placeholder ) {
if ( ! empty( $fsmsp_placeholder ) ) {
$fsmsp_placeholder = esc_attr( $fsmsp_placeholder );
} else {
$fsmsp_placeholder = esc_attr_x( 'Search …', 'placeholder', 'full-screen-morphing-search' );
@@ -127,8 +128,7 @@ class Full_Screen_Morphing_Search {
if ( has_post_thumbnail() ) {
echo the_post_thumbnail( 'full-screen-morphing-search-plugin-thumb', array( 'class' => 'round' ) );
} else {
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- strict comparison not working !
if ( '' == $fsmsp_options['fsmsp_article_icon'] ) {
if ( empty( $fsmsp_options['fsmsp_article_icon'] ) ) {
echo '<img src="' . esc_url( plugins_url( 'assets/img/article.png', __FILE__ ) ) . '" >';
} else {
full_screen_morphing_search_article_icon();
@@ -168,8 +168,7 @@ class Full_Screen_Morphing_Search {
<div class="dummy-media-object fsmsp-tc-child">
<span class="fsmsp-category-image">
<?php
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- strict comparison not working !
if ( '' == $fsmsp_options['fsmsp_category_icon'] ) {
if ( empty( $fsmsp_options['fsmsp_category_icon'] ) ) {
echo '<img src="' . esc_url( plugins_url( 'assets/img/category.png', __FILE__ ) ) . '" >';
} else {
full_screen_morphing_search_category_icon();
+3 -3
View File
@@ -331,7 +331,7 @@ if ( class_exists( 'Kirki' ) ) {
$attachment_id = attachment_url_to_postid( $image_url ); // Tries to convert an attachment URL into a post ID.
$article_i_classes = get_option( 'fsmsp_options' )['fsmsp_article_i_classes'];
$classes;
if ( true === $article_i_classes ) {
if ( ! empty( $article_i_classes ) ) {
$classes = 'round fsmsp-article-icon';
} else {
$classes = 'fsmsp-article-icon';
@@ -382,7 +382,7 @@ if ( class_exists( 'Kirki' ) ) {
$attachmentcat_id = attachment_url_to_postid( $imagecat_url );
$category_i_classes = get_option( 'fsmsp_options' )['fsmsp_category_i_classes'];
$classes;
if ( true === $category_i_classes ) {
if ( ! empty( $category_i_classes ) ) {
$classes = 'round fsmsp-category-icon';
} else {
$classes = 'fsmsp-category-icon';
@@ -433,7 +433,7 @@ if ( class_exists( 'Kirki' ) ) {
$attachmenttag_id = attachment_url_to_postid( $imagetag_url );
$tag_i_classes = get_option( 'fsmsp_options' )['fsmsp_tag_i_classes'];
$classes;
if ( true === $tag_i_classes ) {
if ( ! empty( $tag_i_classes ) ) {
$classes = 'round fsmsp-tag-icon';
} else {
$classes = 'fsmsp-tag-icon';