Changes between Initial Version and Version 3 of Ticket #50019
- Timestamp:
- 04/27/2020 07:50:11 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #50019 – Description
initial v3 1 1 After updating my local sandbox to PHP 7.4, I started seeing errors on my Edit Page screen for my custom post type: 2 2 3 Notice: Trying to access array offset on value of type bool in /[..]/wp-admin/includes/template.php on line 1079, 1080, 10813 Notice: Trying to access array offset on value of type bool in /[..]/wp-admin/includes/template.php on line 1079, 1080, 1081 4 4 5 5 After some research, I narrowed down the issue to a call in one of my plugin, which removes one of the metaboxes on that screen: 6 6 {{{ 7 7 remove_meta_box( 'profile_rolediv', 'people', 'normal' ); 8 8 }}} 9 9 Everything had been working fine in earlier versions. Looking at the code in template.php, it looks like remove_meta_box just sets values to false, instead of removing the entry: 10 10 {{{ 11 11 function remove_meta_box( $id, $screen, $context ) { 12 12 . … … 16 16 . 17 17 } 18 18 }}} 19 19 which then causes this line in template.php to fail: 20 20 {{{ 21 21 $title = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['title']; 22 22 }}} 23 23 Changing line 1078 in wp-admin/includes/template.php fixes the issue: 24 24 {{{ 25 25 } elseif ( 'sorted' == $priority && is_array( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ) ) { 26 26 }}} 27 27 Thank you, 28 28 Jason