WordPress.org

Ready to get started?Download WordPress

Forums

Dashboard: Scheduled Posts
[resolved] Notice: attribute_escape and Undefined index on WP 3.1.3 (6 posts)

  1. Cor van Noorloos
    Member
    Posted 3 years ago #

    Hello,

    Using WordPress 3.1.3 I'm receiving a few notices:

    Notice: attribute_escape is deprecated since version 2.8! Use esc_attr() instead. in /home/design24/public_html/klanten/23/wp-includes/functions.php on line 3303

    which was an easy fix, but

    Notice: Undefined index: dashboard_scheduled_posts in /home/design24/public_html/klanten/23/wp-admin/includes/dashboard.php on line 120

    is a bit beyond my knowledge.

    Would someone know a solution for this perhaps?

    Best regards,

    Cor

  2. s_ha_dum
    Member
    Posted 3 years ago #

    It means the script is trying to use an array index that doesn't exist. For example:

    $pets = array('cats'=>2,'dogs'=>5);
    echo $pets['dogs']; // this is fine
    echo $pets['rabbits']; // this will give the notice you see
  3. Cor van Noorloos
    Member
    Posted 3 years ago #

    Thanks apljdi,

    In this case it seemed to be somewhat else.
    For future reference the first noticed is pretty much self-explanatory, changing attribute_escape with esc_attr.

    Thanks to Utkarsh the second can be solved by changing wp_register_sidebar_widget('dashboard_scheduled_posts', __('Scheduled', 'dashboard-scheduled-posts'), array(&$this, 'widget')); to wp_add_dashboard_widget('dashboard_scheduled_posts', __('Scheduled', 'dashboard-scheduled-posts'), array(&$this, 'widget'));

  4. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 3 years ago #

    Change your error reporting level in PHP. You shouldn't be displaying notices in production environments, only development environments.

    Notices are just minor error messages that don't really affect anything.

  5. Cor van Noorloos
    Member
    Posted 3 years ago #

    Hello Alex,

    Thanks! As I don't have the experience, I can't really comment on how these notices would affect.
    But as they still remain as error messages, being displayed or not, I'm sure you can understand I don't really want them at all.

    Hope you won't blame me for being a bit overly tidy in that sort of things sometimes (:

  6. s_ha_dum
    Member
    Posted 3 years ago #

    I try to get rid of the notices too, but as Alex M. said, they don't really effect anything. The (PHP) script should work fine. Under some circumstances (the details of which I haven't quite worked out) printing those notices can break Javascript though.

    The reason you don't want the notices to print on a production site is that they can give a knowledgeable, and malicious, visitor clues that might help in attacking the site.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic