From 69a3b08cf65f4731925b9b44d9c6433911d2e21f Mon Sep 17 00:00:00 2001 From: Daniel Espinoza Date: Wed, 22 Feb 2023 14:52:13 -0600 Subject: [PATCH] Fix warning for undefined array key. --- classes/class-dfrps-cpt.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/class-dfrps-cpt.php b/classes/class-dfrps-cpt.php index ab6db03..e8da8fe 100644 --- a/classes/class-dfrps-cpt.php +++ b/classes/class-dfrps-cpt.php @@ -1132,7 +1132,7 @@ function last_update_status() { $post = $GLOBALS['post']; $meta = get_post_custom( $post->ID ); - $completed = $meta['_dfrps_cpt_last_update_time_completed'][0]; + $completed = ( isset( $meta['_dfrps_cpt_last_update_time_completed'][0] ) ) ? $meta['_dfrps_cpt_last_update_time_completed'][0] : 0; $update_errors = ( isset( $meta['_dfrps_cpt_errors'][0] ) ) ? maybe_unserialize( $meta['_dfrps_cpt_errors'][0] ) : ''; // Show last update stats @@ -1140,7 +1140,7 @@ function last_update_status() { // Is updating now or has never updated. // Show values from '_dfrps_cpt_previous_update_info' meta field if exists. $meta = ( isset( $meta['_dfrps_cpt_previous_update_info'][0] ) ) ? maybe_unserialize( $meta['_dfrps_cpt_previous_update_info'][0] ) : array(); - $completed = $meta['_dfrps_cpt_last_update_time_completed'][0]; + $completed = ( isset( $meta['_dfrps_cpt_last_update_time_completed'][0] ) ) ? $meta['_dfrps_cpt_last_update_time_completed'][0] : 0; } if ( !isset( $meta['_dfrps_cpt_last_update_time_completed'][0] ) ) {