Title: PHP Warnings
Last modified: February 27, 2024

---

# PHP Warnings

 *  Resolved [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/)
 * Hi,
 * This is a strange Warning that appeared WITHOUT touching anything in your widget.
   I just added a NEW widget from an other plugin and moved it above your’s.
 * [27-Feb-2024 10:23:38 UTC] PHP Warning: Undefined array key “widget_id” in /home/
   public_html/wp-content/plugins/top-10/includes/frontend/widgets/class-posts-
   
   widget.php on line 285
 * Lines 285, same on 356, 357, 350 , 339, 285
 * Thanks

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457637)
 * Can you try removing the widget and then adding it back in? Remember the configurations
   when you remove it. The widget_id should exist so it’s quite strange as it’s 
   given an error that it doesn’t.
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457708)
 * Does it matter if i add it with classic widgets or Gutenberg?
 * I use classic widgets because i see no option in Gutenberg to change the Title
   of the widgets, shows “Currently trending:”
    -  This reply was modified 2 years, 3 months ago by [dimal](https://wordpress.org/support/users/dimalifragis/).
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457717)
 * Both are build differently – the former is the traditional widget. That is what
   is created by the code above.
 * The gutenberg one is the block and you might have to add the heading separately
   etc
 * I tend to use one or the other on my sites – more the block in recent times.
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457730)
 * I use classic widgets because i see no option in Gutenberg to change the Title
   of the widgets, shows “Currently trending:”
 * i’m missing something?
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457738)
 * Either way i still get the warnings. They seem to happen only when i move up 
   down.
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457739)
 * You’ll need to turn off the heading (in block settings panel) and then add your
   own heading. Then if you right click on both you can group them into a “widget
   group”.
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457744)
 * Do the warnings disappear when you save the widgets page and check on the frontend?
 * I’m wondering if this is a temporary thing that the widget_id is being changed
   so you get this error.
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457755)
 * Yes, only once (several for the lines i mentioned), but once i clear them out,
   i never seen those again if i don’t up/down the widget.
 * So i’m ok, i guess. I see no other problem.
 * I use also Widget Context plugin, to display some widgets where i want and where
   not, maybe that has some relation?
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457826)
 * I’ll need to test – never used these before. Which is the plugin you are putting
   up and down and also where are you seeing this error? Screenshot will help as
   I can go do some checking.
 * I’ll mark this resolved for now as it does work barring that warning which I’ll
   need to investigate.
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457860)
 * Ok, i think i found what is the cause. I added the widget with Classic Widgets
   enabled (the old widgets WP interface) and then i disabled Classic Widgets and
   continued with Gutenberg.
 * Thanks.
    -  This reply was modified 2 years, 3 months ago by [dimal](https://wordpress.org/support/users/dimalifragis/).
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457866)
 * That’s interesting. I think I had to change things with Gutenberg as it didn’t
   do the typical separate ID etc. But, it has been a while.
 * Definitely worth pointing to people in case someone else has an issue.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘PHP Warnings’ is closed to new replies.

 * ![](https://ps.w.org/top-10/assets/icon-256x256.png?rev=2986432)
 * [WebberZone Top 10 — Popular Posts](https://wordpress.org/plugins/top-10/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/top-10/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/top-10/)
 * [Active Topics](https://wordpress.org/support/plugin/top-10/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/top-10/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/top-10/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/php-warnings-183/#post-17457866)
 * Status: resolved