$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts WHERE post_type='post' AND post_status='publish' AND post_author='".$post->post_author."' AND post_date < '".$post->post_date."' ORDER BY post_date DESC LIMIT 1;");
if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
wp_load_translations_early();
header( 'Content-Type: text/html; charset=utf-8' );
die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
}
success: function(data) {
if ( data === 'ok' ) {
// делаем если ok
} else {
// иначе
}
}