Blog : Allow WordPress to upload Flash SWF files
Blog Catatan

Blog : Allow WordPress to upload Flash SWF files

Wah…. karena WP tak sengaja ke update ke versi terakhir (WordPress 4.6.1) membuat tidak bisa upload file SWF (Flash). Setelah ane cari-cari ada sebuah cara untuk dapat upload file SWF di WordPress. cara nya dengan menambahkan Script fungsi baru di functions.php (Theme).

/* allow upload flash */
add_filter('upload_mimes', 'caton_upload_swf');
function caton_upload_swf($existing_mimes){
$existing_mimes['swf'] = 'text/swf'; //allow swf files
return $existing_mimes;
}
/* allow upload flash */

Atau dengan cara kedua :

function caton_allow_swf($mimes) {
    if ( function_exists( 'current_user_can' ) )
        $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
    if ( !empty( $unfiltered ) ) {
        $mimes['swf'] = 'application/x-shockwave-flash';
    }
    return $mimes;
}
add_filter('upload_mimes','caton_allow_swf');

Cara yang saya pakai adalah cara pertama dan sukses.

Epaper SOLOPOS cetak.solopos.com
Epaper SOLOPOS
cetak.solopos.com

selamat Mencoba dan Terima Kasih.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.