daily pastebin goal
68%
SHARE
TWEET

WordPress - Allow .swf uploads

lorro Dec 22nd, 2016 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top