Description


This hook is triggered after import each package, when you using bulk import from CSV or dir.

Parameters


Two parameters/arguments are passed to this hook.

Usage


<?php add_action("after_add_package", "your_function", 10, 2); ?>

Examples

<?php
add_action("after_add_package", "your_function", 10, 2);
function your_function($post_id, $file_info){
    $edit = "<a href=".get_edit_post_link( $post_id).">Edit Package</a>"; 
    $view = "<a href=".get_permalink( $post_id ).">Edit Package</a>";
    $message = "Package Title: {$file_info['post_title']}
    {$view}
    {$edit}";
    wp_mail(get_option("admin_email"), "Package Imported Successfully", $message, "From: no-reply@sitename\r\nContent-type: text/html\r\n"); 
}

?>

Related


Last Updated: Feb 18, 2016


Leave a Reply