Skip to content

Commit d41fe87

Browse files
authored
Fix lloc#226
1 parent 66ae2fe commit d41fe87

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

includes/ContentImport/Importers/PostFields/Duplicating.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ public static function info() {
3232
}
3333

3434
public function import( array $data ) {
35-
// Set the post type reading it from the request payload, if not possible, use the default one.
36-
$data['post_type'] = $this->read_post_type_from_request( 'post' );
37-
3835
$source_post = $this->import_coordinates->source_post;
36+
// Set the post type same as source post, or reading it from the request payload, if not possible, use the default one.
37+
$data['post_type'] = empty( $source_post->post_type ) ? $this->read_post_type_from_request( 'post' ) : $source_post->post_type;
3938

4039
foreach ( $this->filter_fields() as $field ) {
4140
$value = $source_post->{$field};

0 commit comments

Comments
 (0)