From 22a7ad8c09d21848102a6a5a9d71d5da69112589 Mon Sep 17 00:00:00 2001 From: Jeff Farthing Date: Thu, 21 Dec 2017 18:04:29 -0500 Subject: [PATCH] Update wordpress-importer.php Adds two new hooks, `before_process_import` and `after_process_import`, to make it more intuitive to add additional processing to the import process. --- src/wordpress-importer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wordpress-importer.php b/src/wordpress-importer.php index 947997a..debd591 100755 --- a/src/wordpress-importer.php +++ b/src/wordpress-importer.php @@ -106,7 +106,9 @@ function import( $file ) { $this->import_start( $file ); $this->get_author_mapping(); - + + do_action( 'before_process_import' ); + wp_suspend_cache_invalidation( true ); $this->process_categories(); $this->process_tags(); @@ -118,6 +120,8 @@ function import( $file ) { $this->backfill_parents(); $this->backfill_attachment_urls(); $this->remap_featured_images(); + + do_action( 'after_process_import' ); $this->import_end(); }