Advertisement
majeedraza

WordPress - Allow .swf uploads

Dec 22nd, 2016
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.   // allow swf uploads
  3.   // (swf uploads are disabled by default as a security hardening measure)
  4.   // code goes in functions.php for your child theme
  5.   add_filter('upload_mimes','allow_swfs');
  6.   function allow_swfs($mimes) {
  7.     if ( function_exists( 'current_user_can' ) )
  8.         $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
  9.     if ( !empty( $unfiltered ) ) {
  10.         $mimes['swf'] = 'application/x-shockwave-flash';
  11.     }
  12.     return $mimes;
  13.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement