• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Customer Servant Consultancy

Where we develop robust web sites with emphasis on accessibility

  • About
  • Our Work
  • Code Snippets
  • Testimonials
  • WordPress With A Screen Reader
  • Let’s Talk
  • Read
  • Note
  • Article
  • Bookmark
  • Like
  • Watch
  • Reply
  • Listen
  • Quote
  • Repost
  • RSVP
  • Issue
  • Video

Add Flac Support To WordPress’s Media Uploader

23 June 2016 by Amanda Rush

< ?php

add_filter( 'upload_mimes', 'ar_add_flac_support' );
/**
 * Introduces functionality that allows us to upload Flac files which are not
 * supported by the enc_type="multipart/form-data" attribute.
 *
 * @param  array $mimes The current array of MIME types that are supported.
 * @return array $mimes The updated array of supported MIME types.
 */
function ar_add_flac_support( $mimes ) {

    $mimes = array_merge(
        $mimes,
        array(
            'flac' => 'application/x-flac',
        )
    );

    return $mimes;

}

Primary Sidebar

Copyright © 2022