Skip to content

Instantly share code, notes, and snippets.

@SirDarcanos
Last active March 6, 2018 05:48
Show Gist options
  • Save SirDarcanos/e4849cb8a23d819c7b1b9847319b9e28 to your computer and use it in GitHub Desktop.
Save SirDarcanos/e4849cb8a23d819c7b1b9847319b9e28 to your computer and use it in GitHub Desktop.
public function is_new_post( $post ) {
$process_old_posts = get_option( 'wp_discord_post_process_old_posts' );
$post_date = strtotime( $post->post_date );
var_dump(
$post_date < current_time( 'timestamp' ),
'yes' === $process_old_posts,
'yes' !== get_post_meta( $post->ID, '_wp_discord_post_published', true )
);
die;
if ( $post_date < current_time( 'timestamp' ) ) {
return 'yes' === $process_old_posts && 'yes' !== get_post_meta( $post->ID, '_wp_discord_post_published', true );
} else {
return 'yes' !== get_post_meta( $post->ID, '_wp_discord_post_published', true );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment