WP-CRM System Custom Fields Protected Directory

The wp_crm_system_custom_fields_protected_directory_allowed_filetypes filter lets you modify the file types that will be protected by the .htaccess file generated in the /wp-content/uploads/wp-crm-system-custom-fields/ directory.

This filter expects that your function will return an array of file extensions.

By default the following extensions are included:

$protected_filetypes = array(
    '3dm',
    '3ds',
    '3g2',
    '3gp',
    '7z',
    'accdb',
    'ai',
    'aif',
    'asf',
    'asp',
    'aspx',
    'avi',
    'bak',
    'bmp',
    'cer',
    'cfm',
    'crx',
    'csr',
    'css',
    'csv',
    'db',
    'dbf',
    'dcr',
    'dds',
    'doc',
    'docx',
    'dwg',
    'dxf',
    'eps',
    'flv',
    'fnt',
    'fon',
    'gif',
    'gpx',
    'gz',
    'heic',
    'htm',
    'html',
    'iff',
    'indd',
    'jpg',
    'jpeg',
    'js',
    'jsp',
    'key',
    'kml',
    'kmz',
    'm3u',
    'm4a',
    'm4v',
    'max',
    'mdb',
    'mid',
    'mov',
    'mp3',
    'mp4',
    'mpa',
    'mpg',
    'obj',
    'ogg',
    'otf',
    'pages',
    'pct',
    'pdb',
    'pdf',
    'php',
    'pkg',
    'plugin',
    'png',
    'pps',
    'ppt',
    'pptx',
    'ps',
    'psd',
    'pspimage',
    'rar',
    'rm',
    'rpm',
    'rss',
    'sitx',
    'sql',
    'srt',
    'svg',
    'swf',
    'tga',
    'thm',
    'tif',
    'tiff',
    'ttf',
    'txt',
    'vcf',
    'vob',
    'wav',
    'wma',
    'wmv',
    'xhtml',
    'xlr',
    'xls',
    'xlsx',
    'xml',
    'yuv',
    'zip',
    'zipx',
);

To modify this list of protected file types:

//Add "odd" file type
add_filter( 'wp_crm_system_custom_fields_protected_directory_allowed_filetypes', 'add_odd_filetype' );
function add_odd_filetype( $protected_filetypes ){
    $protected_filetypes[] = 'odd';
    return $protected_filetypes;
}
// Only protect "jpg", "gif", and "png" file types
add_filter( 'wp_crm_system_custom_fields_protected_directory_allowed_filetypes', 'only_image_filetypes' );
function only_image_filetypes( $protected_filetypes ){
    $protected_filetypes = array(
        'jpg',
        'gif',
        'png',
    );
    return $protected_filetypes;
}