diff --git a/includes/utils.php b/includes/utils.php index e656617a4..ca4565543 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -786,3 +786,14 @@ function get_processed_content( $post_content ) { return $post_content; } + +/** + * Get post in destination using original post id + * + * @param int $original_id Original post id. + * @return null|int + */ +function get_post_id_from_original_id( $original_id ) { + global $wpdb; + return $wpdb->get_var( $wpdb->prepare( "SELECT post_id from $wpdb->postmeta WHERE meta_key = 'dt_original_post_id' AND meta_value = %s", $original_id ) ); +}