Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Created August 1, 2020 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plugin-republic/a859d6065a085625061e945194867231 to your computer and use it in GitHub Desktop.
Save plugin-republic/a859d6065a085625061e945194867231 to your computer and use it in GitHub Desktop.
<?php
// Set the list of permitted mime types to zip only
function prefix_only_permit_zip( $permitted_mimes ) {
$permitted_mimes = array( 'zip' => "application/zip" );
return $permitted_mimes;
}
add_filter( 'pewc_permitted_mimes', 'prefix_only_permit_zip' );
// Add PDF to the list of restricted filetypes
function prefix_protected_directory_zip_only( $restricted_filetypes ) {
$restricted_filetypes = array( 'zip' );
return $restricted_filetypes;
}
add_filter( 'pewc_protected_directory_allowed_filetypes', 'prefix_protected_directory_zip_only' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment