diff -r be944660c56a -r 3d72ae0968f4 wp/wp-admin/includes/class-wp-media-list-table.php --- a/wp/wp-admin/includes/class-wp-media-list-table.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-admin/includes/class-wp-media-list-table.php Tue Sep 27 16:37:53 2022 +0200 @@ -78,12 +78,16 @@ */ $not_in = array(); - foreach ( _get_cron_array() as $cron ) { - if ( isset( $cron['upgrader_scheduled_cleanup'] ) ) { - $details = reset( $cron['upgrader_scheduled_cleanup'] ); + $crons = _get_cron_array(); - if ( ! empty( $details['args'][0] ) ) { - $not_in[] = (int) $details['args'][0]; + if ( is_array( $crons ) ) { + foreach ( $crons as $cron ) { + if ( isset( $cron['upgrader_scheduled_cleanup'] ) ) { + $details = reset( $cron['upgrader_scheduled_cleanup'] ); + + if ( ! empty( $details['args'][0] ) ) { + $not_in[] = (int) $details['args'][0]; + } } } } @@ -147,7 +151,7 @@ ); } - $type_links['detached'] = ''; + $type_links['detached'] = ''; $type_links['mine'] = sprintf( '', @@ -383,10 +387,14 @@ * Handles the checkbox column output. * * @since 4.3.0 + * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * - * @param WP_Post $post The current WP_Post object. + * @param WP_Post $item The current WP_Post object. */ - public function column_cb( $post ) { + public function column_cb( $item ) { + // Restores the more descriptive, specific name for use within this method. + $post = $item; + if ( current_user_can( 'edit_post', $post->ID ) ) { ?>