Skip to main content
1 of 11
ClemC
  • 2k
  • 21
  • 26

According to the codex, you're manipulating get_most_recent_post_of_user() the wrong way.
get_most_recent_post_of_user() directly returns the post_date_gmt among blog_id, post_id, and post_gmt_ts.

So firstly, to get last post's date:

$user_id        = $post->post_author;
$last_post      = get_most_recent_post_of_user( $user_id );
$last_post_date = $author_last_post['post_date_gmt'];

Then, get the other post's date to compare against the last post's date:

$post_date = $post->post_date_gmt;

Note that we now have 2 GMT dates to deal with. For comparaison, we'll convert them to timestamp:

$last_post_date = strtotime( $last_post_date );
$post_date      = strtotime( $post_date );

if ( $post_date < $last_post_date )
    return;
ClemC
  • 2k
  • 21
  • 26