Skip to content

Commit

Permalink
Handle data sent by older versions of XPoster Pro.
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed May 14, 2024
1 parent ce2c478 commit 7a9eb45
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/wpt-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,13 @@ function wpt_show_last_tweet() {
} else {
$title = '(' . __( 'No post', 'wp-to-twitter' ) . ')';
}
$notice = esc_html( $log[1]['message'] );
$code = esc_html( $log[1]['http'] );
if ( is_array( $log[1] ) ) {
$notice = esc_html( $log[1]['message'] );
$code = esc_html( $log[1]['http'] );
} else {
$notice = esc_html( $log[1] );
$code = '';
}
echo "<div class='updated'><p><strong>" . __( 'Last Status Update', 'wp-to-twitter' ) . ": <code>$code</code></strong> $title &raquo; $notice</p></div>";
}
}
Expand Down

0 comments on commit 7a9eb45

Please sign in to comment.