inpsyde / wpml2mlp

Convert posts from an existing WPML multilingual site via WXR Export/Import for MultilingualPress
https://wordpress.org/plugins/wpml-to-multilingualpress/
GNU General Public License v2.0
10 stars 6 forks source link

Consolidate action signatures in Service\Wp{TYPE}Importer's #39

Closed dnaber-de closed 8 years ago

dnaber-de commented 8 years ago

Replace {TYPE} with

Use always singular unless it is specified in a different way!

Import (wp_insert_{TYPE}) failed

/**
 * Attach error handler/logger here
 *
 * @param WP_Error $error
 * @param Type\Import{TYPE}Interface $import_{TYPE}
 */
do_action( 'w2m_import_{TYPE}_error', $error, $import_{TYPE} );

Parent object does not exist

(Only for term, post and comment.)

/**
 * @param WP_{TYPE} $wp_{TYPE}
 * @param Type\Import{TYPE}Interface $import_{TYPE}
 */
do_action( 'w2m_import_missing_{TYPE}_ancestor', $wp_{TYPE}, $import_{TYPE} );

{TYPE} successfully imported

/**
 * @param WP_{TYPE} $wp_{TYPE}
 * @param Type\Import{TYPE}Interface $import_{TYPE}
 */
do_action( 'w2m_{TYPE}_imported', $wp_{TYPE}, $import_{TYPE} );

Additional errors

E.g. when linking of terms or insertion of meta data fails. Please use the following scheme for the parameter signature of any actions: WP_Error, Import_Element Pass any contextual data with the WP_Error object like it's done in the parsers.