Inventory_Presser_Plugin::maybe_force_delete( int $post_id )
Action hook callback. Prevents vehicles from lingering in the Trash after they’ve been deleted if a plugin setting dictates such behavior.
On This Page
Parameters Parameters
- $post_id
-
(int) (Required)
Return Return
(void)
Source Source
File: inventory-presser.php
public function maybe_force_delete( $post_id ) {
// is the post a vehicle?
if ( INVP::POST_TYPE !== get_post_type( $post_id ) ) {
return;
}
$settings = INVP::settings();
if ( ! $settings['skip_trash'] ) {
return;
}
// force delete.
wp_delete_post( $post_id, true );
}
Expand full source codeCollapse full source codeView on Github