Skip to content

Instantly share code, notes, and snippets.

@rosshanney
Created August 23, 2012 15:16
Show Gist options
  • Save rosshanney/3437658 to your computer and use it in GitHub Desktop.
Save rosshanney/3437658 to your computer and use it in GitHub Desktop.
Allow file:/// protocol in WordPress
<?php
/*
Plugin name: Allow file protocol
*/
function rh_allow_file_protocol( $protocols ) {
$protocols[] = 'file';
return $protocols;
}
add_filter( 'kses_allowed_protocols', 'rh_allow_file_protocol' );
@ClarusDignus
Copy link

Very useful but why not add this to the WordPress plugin repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment