From da51a56ef6e5d98a1d049d7e1eccb1b70a8f77b0 Mon Sep 17 00:00:00 2001 From: Peter Schmidtke Date: Sun, 16 Sep 2018 02:30:42 +0200 Subject: [PATCH] Update html-importer.php Adding explicit array definition avoids fails of multiple file import. --- html-importer.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/html-importer.php b/html-importer.php index 7778872..2d869e3 100644 --- a/html-importer.php +++ b/html-importer.php @@ -606,9 +606,10 @@ function get_post( $path = '', $placeholder = false ) { // see if the post already exists // but don't bother printing this message if we're doing an index file; we know its parent already exists - if ( $post_id = post_exists( $my_post['post_title'], $my_post['post_content'], $my_post['post_date'] ) && basename( $path ) != $options['index_file'] ) + if ( $post_id = post_exists( $my_post['post_title'], $my_post['post_content'], $my_post['post_date'] ) && basename( $path ) != $options['index_file'] ){ + $this->table=array(); $this->table[] = "-- " . sprintf( __( "%s ( %s ) has already been imported", 'html-import-pages' ), $my_post['post_title'], $handle ) . ""; - + } // if we're doing hierarchicals and this is an index file of a subdirectory, instead of importing this as a separate page, update the content of the placeholder page we created for the directory $index_files = explode( ',',$options['index_file'] ); if ( is_post_type_hierarchical( $options['type'] ) && dirname( $path ) != $options['root_directory'] && in_array( basename( $path ), $index_files ) ) { @@ -1198,4 +1199,4 @@ function mb_strlen( $string ) { function mb_strrpos( $haystack, $needle, $offset = 0 ) { return strrpos( utf8_decode( $haystack ), $needle, $offset ); } -} \ No newline at end of file +}