WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 6 months ago

#50122 closed defect (bug) (duplicate)

PHP Notice: Trying to access array offset on value of type bool in ...

Reported by: franzarmas Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.4.1
Component: Administration Keywords:
Focuses: Cc:

Description

Hello,

I just updated my version of PHP 7.4 and I see that one of my functions produces PHP Notice.

My code is:

Code highlighting:

/**
 * Remove widgets of the dashboard.
 */
function remove_dashboard_widgets() {
        remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
}
add_action( 'wp_dashboard_setup', 'remove_dashboard_widgets' );

Generate this:

[07-May-2020 23:25:38 UTC] PHP Notice: Trying to access array offset on value of type bool in /home/...../wp-admin/includes/template.php on line 1079

[07-May-2020 23:25:38 UTC] PHP Notice: Trying to access array offset on value of type bool in /home/...../wp-admin/includes/template.php on line 1080

[07-May-2020 23:25:38 UTC] PHP Notice: Trying to access array offset on value of type bool in /home/...../wp-admin/includes/template.php on line 1081

Change History (1)

#1 @SergeyBiryukov
6 months ago

  • Component changed from General to Administration
  • Keywords php74 removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Hi there, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #50019.

Note: See TracTickets for help on using tickets.