Skip to content

Commit

Permalink
Merge pull request #25 from datafeedr/issue/24
Browse files Browse the repository at this point in the history
Fix warning for undefined array key.
  • Loading branch information
EricBusch authored Feb 23, 2023
2 parents 83bfc2f + 69a3b08 commit cbb1ae1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/class-dfrps-cpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -1132,15 +1132,15 @@ 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
if ( $completed == 0 ) {
// 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] ) ) {
Expand Down

0 comments on commit cbb1ae1

Please sign in to comment.