WordPress.org

Ready to get started?Download WordPress

Forums

Social Media Widget
NOTICE: Undefined index: filter (3 posts)

  1. Twanneman
    Member
    Posted 6 months ago #

    I got this notice / error :
    NOTICE: wp-content/plugins/social-media-widget/social-widget.php:443 - Undefined index: filter

    Changing this :
    echo "<div class=\"socialmedia-text\>" . $instance['filter'] ? wpautop($text) : $text . '</div>';
    to this :
    echo "<div class=\"socialmedia-text\>" . $text . '</div>';

    removed the notice.

    If I change this would that break specific functionality of the plugin ?

    http://wordpress.org/plugins/social-media-widget/

  2. poddys
    Member
    Posted 3 months ago #

    When WP-Debug is turned on the following error shows above the icons in the widget area of the sidebar:

    Notice: Undefined index: filter in /www/zendsvr/htdocs/news/wp-content/plugins/social-media-widget/social-widget.php on line 443

    Same problem, but in our case only showing when Debug is on.

  3. robbedoes
    Member
    Posted 2 weeks ago #

    Notice: Undefined index: filter in \wp-content\plugins\social-media-widget\social-widget.php on line 443 in version 4.0.2.

    This error occurs because the code that causes the error is borrowed from the WordPress Text widget. It's the checkbox that says "Automatically add paragraphs" which (like the checkbox says) automaticly adds paragraphs to the text.

    However the checkbox was not borrowed, so like Twanneman stated changing the code on line 443 of \wp-content\plugins\social-media-widget\social-widget.php to:

    echo "<div class=\"socialmedia-text\>" . $text . "</div>";

    is the cleanest solution.

    Note to the plugin developer:
    The code for the form of the "Automatically add paragraphs" checkbox (in WordPress 3.9.1) can be found in \wp-includes\default-widgets.php on line 528:

    <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs'); ?></label></p>

    and the code to save the value can be found on line 514 of the same file (\wp-includes\default-widgets.php):

    $instance['filter'] = isset($new_instance['filter']);

    Please update this plugin, because we use it regularly.

    Thanks in advance! :)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.