Skip to content

Commit 52671e6

Browse files
jessedyckclaude
andcommitted
Fix --only flag silently dropping custom post type IDs
When --only is used with explicit post IDs, the query still applied the default post_type constraint (['post', 'page']), so any IDs belonging to custom post types were dropped from the migration queue without warning. Set post_type='any' inside the --only branch so all explicitly supplied IDs are respected regardless of their post type. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d4f23ad commit 52671e6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

includes/ConvertToBlocks/MigrationAgent.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ public function get_posts_to_update( $opts = [] ) {
223223
$post_in = array_map( 'intval', $post_in );
224224
$post_in = array_filter( $post_in );
225225

226-
$query_params['post__in'] = $post_in;
226+
$query_params['post__in'] = $post_in;
227+
$query_params['post_type'] = 'any';
227228
}
228229

229230
$query = new \WP_Query( $query_params );

0 commit comments

Comments
 (0)