Skip to content

Instantly share code, notes, and snippets.

@sudar
Created November 17, 2018 05:37
Show Gist options
  • Save sudar/a376471251db429cde2167e3581afd36 to your computer and use it in GitHub Desktop.
Save sudar/a376471251db429cde2167e3581afd36 to your computer and use it in GitHub Desktop.
Exclude attachments from getting deleted using the Bulk Delete Attachments add-on for Bulk Delete plugin
<?php
add_filter( 'bd_delete_attachment_excluded_attachment_ids', 'prefix_exclude_attachment_ids_from_deletion' );
function prefix_exclude_attachment_ids_from_deletion( $attachment_ids ) {
return array(
100,
111,
112,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment