WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Function Reference/wp get mime types"

m (Changelog: Link version 3.5)
(Include more information about the function)
Line 1: Line 1:
 
== Description ==
 
== Description ==
+
Retrieve list of mime types and file extensions.
 
== Usage ==
 
== Usage ==
   
%%% <?php ?> %%%
+
%%% <?php $mime_types = wp_get_mime_types() ?> %%%
   
 
== Parameters ==
 
== Parameters ==
+
== Return Values ==
  +
{{Return||array|Array of mime types keyed by the file extension regex corresponding to those types.}}
 
== Examples ==
 
== Examples ==
   
 
=== Default Usage ===
 
=== Default Usage ===
  +
  +
== Notes ==
  +
Applies the filter <tt>mime_types</tt> to return value, passing the array of mime types. This filter should be used to add types, not remove them. To remove types use the <tt>upload_mimes</tt> filter.
   
 
== Change Log ==
 
== Change Log ==
Line 17: Line 20:
 
== Source File ==
 
== Source File ==
   
<tt> </tt> is located in {{Trac| }}
+
<tt>wp_get_mime_types()</tt> is located in {{Trac|wp-includes/functions.php}}
   
 
== Related ==
 
== Related ==

Revision as of 18:17, 12 December 2012

Description

Retrieve list of mime types and file extensions.

Usage

 <?php $mime_types wp_get_mime_types() ?> 

Parameters

Return Values

(array) 
Array of mime types keyed by the file extension regex corresponding to those types.

Examples

Default Usage

Notes

Applies the filter mime_types to return value, passing the array of mime types. This filter should be used to add types, not remove them. To remove types use the upload_mimes filter.

Change Log

Source File

wp_get_mime_types() is located in wp-includes/functions.php

Related