From ff9369cb4d2c6064450b8278522f94db8f057937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Droz?= Date: Fri, 1 Sep 2017 19:29:16 -0300 Subject: [PATCH] --with_attachments=0 must strip attachments when intending to dump the full instance --- src/WP_Export_Query.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/WP_Export_Query.php b/src/WP_Export_Query.php index 97250b061..a512d5966 100644 --- a/src/WP_Export_Query.php +++ b/src/WP_Export_Query.php @@ -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 ); }