Skip to content

Commit

Permalink
Fix lloc#226
Browse files Browse the repository at this point in the history
  • Loading branch information
belenski authored May 18, 2023
1 parent 66ae2fe commit d41fe87
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions includes/ContentImport/Importers/PostFields/Duplicating.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ public static function info() {
}

public function import( array $data ) {
// Set the post type reading it from the request payload, if not possible, use the default one.
$data['post_type'] = $this->read_post_type_from_request( 'post' );

$source_post = $this->import_coordinates->source_post;
// Set the post type same as source post, or reading it from the request payload, if not possible, use the default one.
$data['post_type'] = empty( $source_post->post_type ) ? $this->read_post_type_from_request( 'post' ) : $source_post->post_type;

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

0 comments on commit d41fe87

Please sign in to comment.