Skip to content

Commit

Permalink
--with_attachments=0 must strip attachments when intending to dump th…
Browse files Browse the repository at this point in the history
…e full instance
  • Loading branch information
Raphaël Droz committed Sep 1, 2017
1 parent 7bb16b2 commit ff9369c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/WP_Export_Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ private function post_type_where() {
$this->wheres[] = 'p.post_type IS NULL';
return;
}

if ( $this->filters['with_attachments'] == FALSE && ( !$this->filters['post_type'] || !in_array( "attachment", $this->filters['post_type'] ) ) ) {
unset( $post_types['attachment'] );
}

$this->wheres[] = _wp_export_build_IN_condition( 'p.post_type', $post_types );
}

Expand Down

0 comments on commit ff9369c

Please sign in to comment.