diff --git a/src/SeedPostsCommand.php b/src/SeedPostsCommand.php index 1123581..f97484b 100644 --- a/src/SeedPostsCommand.php +++ b/src/SeedPostsCommand.php @@ -95,4 +95,23 @@ private function create_post() { return $post_id; } + /** + * Seed the database with dummy meta fields. + * + * @param array $args Command arguments. + * @param array $assoc_args Command associative arguments. + * @return void + */ + public function custom_fields( $args, $assoc_args ) { + $post_type = search( + 'Which post type do you want to seed?', + fn ( string $value ) => strlen( $value ) > 0 + ? PostTypes::get_post_types_for_dropdown( $value ) + : [] + ); + + $this->set_post_type( $post_type ); + + parent::custom_fields( $args, $assoc_args ); + } }