Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Merge pull request #52 from inpsyde/issue_48
Browse files Browse the repository at this point in the history
Fixes #51
  • Loading branch information
dnaber-de committed Jan 29, 2016
2 parents c93c572 + e01b342 commit 3a05ffd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions inc/Import/Service/WpPostImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,22 @@ public function import_post( Type\ImportPostInterface $import_post ) {
return;
}

/**
* trigger action if local user id not solved
*/
if ( empty( $local_user_id ) || $local_user_id == 0 ) {

$error = new WP_Error( 'local_user_id_missing', "Local user is empty or 0." );

/**
* @param stdClass|WP_Post $wp_post
* @param Type\ImportPostInterface $import_post
*/
do_action( 'w2m_import_missing_post_local_user_id', $error, $wp_post, $import_post );

return;
}

$taxonomies = array();

foreach ( $import_post->terms() as $term ) {
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Use the installer via back-end of your install or ...

* `w2m_import_post_error` in `W2M\Import\Service\WpPostImporter::import_post()`
* `w2m_import_missing_post_ancestor` in `W2M\Import\Service\WpPostImporter::import_post()`
* `w2m_import_missing_post_local_user_id` in `W2M\Import\Service\WpPostImporter::import_post()`
* `w2m_import_set_post_terms_error` in `W2M\Import\Service\WpPostImporter::import_post()`
* `w2m_import_update_post_meta_error` in `W2M\Import\Service\WpPostImporter::import_post()`
* `w2m_post_imported` in `W2M\Import\Service\WpPostImporter::import_post()`
Expand Down

0 comments on commit 3a05ffd

Please sign in to comment.