* Declare $site_mimes before using it in check_upload_mimes().
* Use the same default value for 'upload_filetypes' as on Network Settings screen. props rmccue. fixes #29512 for trunk. Built from https://develop.svn.wordpress.org/trunk@29718 git-svn-id: http://core.svn.wordpress.org/trunk@29492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f84cbb4ba8
commit
0e28457536
|
@ -264,7 +264,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
|
<th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
|
||||||
<td><input name="upload_filetypes" type="text" id="upload_filetypes" class="large-text" value="<?php echo esc_attr( get_site_option('upload_filetypes', 'jpg jpeg png gif') ) ?>" size="45" /></td>
|
<td><input name="upload_filetypes" type="text" id="upload_filetypes" class="large-text" value="<?php echo esc_attr( get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ) ?>" size="45" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -1745,7 +1745,8 @@ function recurse_dirsize( $directory ) {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function check_upload_mimes( $mimes ) {
|
function check_upload_mimes( $mimes ) {
|
||||||
$site_exts = explode( ' ', get_site_option( 'upload_filetypes' ) );
|
$site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) );
|
||||||
|
$site_mimes = array();
|
||||||
foreach ( $site_exts as $ext ) {
|
foreach ( $site_exts as $ext ) {
|
||||||
foreach ( $mimes as $ext_pattern => $mime ) {
|
foreach ( $mimes as $ext_pattern => $mime ) {
|
||||||
if ( $ext != '' && strpos( $ext_pattern, $ext ) !== false )
|
if ( $ext != '' && strpos( $ext_pattern, $ext ) !== false )
|
||||||
|
|
Loading…
Reference in New Issue