Created
May 2, 2016 02:22
-
-
Save z2015/a240bd398016e4d0d5bb6c228daf7185 to your computer and use it in GitHub Desktop.
WordPress上传Apk文件到媒体库
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function add_upload_mime_types( $mimes ) { | |
| if ( function_exists( 'current_user_can' ) ) | |
| $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' ); | |
| if ( !empty( $unfiltered ) ) { | |
| $mimes['apk'] = 'application/vnd.android.package-archive'; | |
| } | |
| return $mimes; | |
| } | |
| add_filter( 'upload_mimes', 'add_upload_mime_types' ); | |
| //https://wordpress.org/support/topic/cannot-upload-apk-file-for-security-reasons |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment