Tell us what you are trying to do?
Like same that cred_save_data can do action when save a new post type, are any fuction to do on delete link accion? example send a mail to X person.
Hello, there is no hook specifically for the cred-delete-post shortcode, but WordPress offers the before_delete_post hook: https://codex.wordpress.org/Plugin_API/Action_Reference/before_delete_post
You can test to see if the post being deleted is a specific post type and trigger some relevant custom code like this:
add_action( 'before_delete_post', 'before_delete_function' );
function before_delete_function( $post_id ){
// delete the next three lines if you want to trigger the code when deleting a post in wp-admin
$screen = get_current_screen();
if( is_admin() && $screen )
return;
$post_type = get_post_type( $post_id );
if ( $post_type == 'book' ) {
// add your custom code here
}
}
Replace "book" with the slug of your custom post type.
You can configure the cred-delete-post shortcode to trash a post or delete a post. The hooks above are used when you want to delete the post. You can see Minesh's answer in another ticket to see how to use the post_updated hook to check to see if the post was trashed:
https://toolset.com/forums/topic/before_delete_post-hook-not-working/#post-566759