From 7a9eb45b14c711ffd327a2e3e79033e6f5baa72e Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Tue, 14 May 2024 17:17:39 -0500 Subject: [PATCH] Handle data sent by older versions of XPoster Pro. --- src/wpt-functions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wpt-functions.php b/src/wpt-functions.php index e3d7341..fca57cc 100644 --- a/src/wpt-functions.php +++ b/src/wpt-functions.php @@ -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 "

" . __( 'Last Status Update', 'wp-to-twitter' ) . ": $code $title » $notice

"; } }