ID ) ) { return; } // Skip for menu items. if ( 'nav_menu_item' === get_post_type( $post->ID ) ) { return; } adminify_activity_logs( [ 'action' => $action, 'object_type' => 'Post', 'object_subtype' => $post->post_type, 'object_id' => $post->ID, 'object_name' => $this->_draft_or_post_title( $post->ID ), ] ); } public function hooks_delete_post( $post_id ) { if ( wp_is_post_revision( $post_id ) ) { return; } $post = get_post( $post_id ); if ( ! $post ) { return; } if ( in_array( $post->post_status, [ 'auto-draft', 'inherit' ] ) ) { return; } // Skip for menu items. if ( 'nav_menu_item' === get_post_type( $post->ID ) ) { return; } adminify_activity_logs( [ 'action' => 'deleted', 'object_type' => 'Post', 'object_subtype' => $post->post_type, 'object_id' => $post->ID, 'object_name' => $this->_draft_or_post_title( $post->ID ), ] ); } }