Skip to main content
Forgot second line of code...
Source Link

Found an elegant solution using pre_delete_post:

function modify_pre_delete_post_defaults($delete, $post, $force_delete) { 
    return true; 
}
add_filter( "pre_delete_post", "modify_pre_delete_post_defaults", 10, 3 );

This filters whether a post should be deleted. Returning any other value than $delete prevents deletion.

See more info:

Found an elegant solution using pre_delete_post:

function modify_pre_delete_post_defaults($delete, $post, $force_delete) { 
    return true; 
}

This filters whether a post should be deleted. Returning any other value than $delete prevents deletion.

See more info:

Found an elegant solution using pre_delete_post:

function modify_pre_delete_post_defaults($delete, $post, $force_delete) { 
    return true; 
}
add_filter( "pre_delete_post", "modify_pre_delete_post_defaults", 10, 3 );

This filters whether a post should be deleted. Returning any other value than $delete prevents deletion.

See more info:

Source Link

Found an elegant solution using pre_delete_post:

function modify_pre_delete_post_defaults($delete, $post, $force_delete) { 
    return true; 
}

This filters whether a post should be deleted. Returning any other value than $delete prevents deletion.

See more info: