do_action( 'wpml_delete_package_action', string $package_name, string $package_kind_slug )
Description
This action is deprecated since String Translation 3.2. Please use wpml_delete_package instead.
Deletes a string translation package*. When this action is called, all the data related to the package is deleted: package, strings, strings translations and jobs.
*String translation packages are registered with wpml_register_string and their translations retrieved with wpml_translate_string
Note: This hook requires the WPML String Translation module
Arguments
$package_namestringRequiredThe unique name of the package as it was registered with wpml_register_string$package_kind_slugstringRequiredThe package kind slug as used when it was registered using wpml_register_string
Example Usage
add_action( 'before_delete_post', 'my_deleted_post' ); function my_deleted_post( $post_id ) { $is_a_layout_delete_action = isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'delete_layout_record'; $layout_ids_to_delete = isset( $_POST[ 'layout_id' ] ) ? (array)$_POST[ 'layout_id' ] : array(); if ( $is_a_layout_delete_action && in_array($post_id, $layout_ids_to_delete) ) { $package_name = $post_id; $package_kind_slug = 'layout'; do_action( 'wpml_delete_package_action', $package_name, $package_kind_slug ); } }