Skip to content

Instantly share code, notes, and snippets.

@z2015
Created May 2, 2016 02:22
Show Gist options
  • Select an option

  • Save z2015/a240bd398016e4d0d5bb6c228daf7185 to your computer and use it in GitHub Desktop.

Select an option

Save z2015/a240bd398016e4d0d5bb6c228daf7185 to your computer and use it in GitHub Desktop.
WordPress上传Apk文件到媒体库
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