#54005 closed defect (bug) (worksforme)
Get warning error of "Undefined array key 0" after upgrading to PHP 8.0.9
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.8 |
Component: | Plugins | Keywords: | php8 reporter-feedback |
Focuses: | Cc: |
Description
Get warning errors on my plugin after upgrading to PHP 8.0.9. When calling the action of admin_notice, its return errors are given below:
Warning: Undefined array key 0 in C:\xampp\htdocs\wordpress\wp-includes\plugin.php on line 947
Warning: Undefined array key 0 in C:\xampp\htdocs\wordpress\wp-includes\plugin.php on line 950"
How do I fix this error? Thanks
Change History (8)
#2
@
4 years ago
Yes exactly. Before creating the ticket, I have already deactivated all the installed plugins and also using the same Twenty Twenty One theme.
#3
follow-up:
↓ 5
@
4 years ago
Thanks for the confirmation.
How are you calling admin_notice? In your theme's functions file? Can you share the code?
#5
in reply to:
↑ 3
@
4 years ago
Replying to Hareesh Pillai:
Thanks for the confirmation.
How are you calling admin_notice? In your theme's functions file? Can you share the code?
My issue has been resolved after I replaced add_action with do_action. Before the update, the admin_notice with add_action was working fine. Anyways thanks a lot.
Hi @moazzamgodil
Welcome to WordPress Trac. Thanks for creating the ticket.
To understand the issue better and debug, can you confirm if you are facing it after deactivating all the plugins and activating a bundled theme, say Twenty Twenty One?