Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes

The filter:

add_filter('upload_mimes','restict_mime'); 

function restict_mime($mimes) { 
    $mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'gif' => 'image/gif', 
                'png' => 'image/png', 
    ); 
    return $mimes;
}

From what I understand this will not work for admins or any user with the unfiltered_upload capability. Also have a look at this post Limit image upload to one and disable audio, video and other document file types to uploadLimit image upload to one and disable audio, video and other document file types to upload

An alternative to control size limit would be to use .htaccess or php.ini:

For upload limit you can set in .htaccess one of the following;

LimitRequestBody 1073741824  //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M

For php.ini you can set upload_max_filesize = 1M

I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes

The filter:

add_filter('upload_mimes','restict_mime'); 

function restict_mime($mimes) { 
    $mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'gif' => 'image/gif', 
                'png' => 'image/png', 
    ); 
    return $mimes;
}

From what I understand this will not work for admins or any user with the unfiltered_upload capability. Also have a look at this post Limit image upload to one and disable audio, video and other document file types to upload

An alternative to control size limit would be to use .htaccess or php.ini:

For upload limit you can set in .htaccess one of the following;

LimitRequestBody 1073741824  //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M

For php.ini you can set upload_max_filesize = 1M

I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes

The filter:

add_filter('upload_mimes','restict_mime'); 

function restict_mime($mimes) { 
    $mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'gif' => 'image/gif', 
                'png' => 'image/png', 
    ); 
    return $mimes;
}

From what I understand this will not work for admins or any user with the unfiltered_upload capability. Also have a look at this post Limit image upload to one and disable audio, video and other document file types to upload

An alternative to control size limit would be to use .htaccess or php.ini:

For upload limit you can set in .htaccess one of the following;

LimitRequestBody 1073741824  //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M

For php.ini you can set upload_max_filesize = 1M

I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes

The filter:

add_filter('upload_mimes','restict_mime'); 

function restict_mime($mimes) { 
    $mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'gif' => 'image/gif', 
                'png' => 'image/png', 
    ); 
    return $mimes;
}

From what I understand this will not work for admins or any user with the unfiltered_upload capability. Also have a look at this post Limit image upload to one and disable audio, video and other document file types to upload

An alternative to control size limit would be to use .htaccess or php.ini:

For upload limit you can set in .htaccess one of the following;

LimitRequestBody 1073741824  //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M

For php.ini you can set upload_max_filesize = 1M

I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes

The filter:

add_filter('upload_mimes','restict_mime'); 

function restict_mime($mimes) { 
$mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'gif' => 'image/gif', 
                'png' => 'image/png', 
); 

From what I understand this will not work for admins or any user with the unfiltered_upload capability. Also have a look at this post Limit image upload to one and disable audio, video and other document file types to upload

An alternative to control size limit would be to use .htaccess or php.ini:

For upload limit you can set in .htaccess one of the following;

LimitRequestBody 1073741824  //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M

For php.ini you can set upload_max_filesize = 1M

I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes

The filter:

add_filter('upload_mimes','restict_mime'); 

function restict_mime($mimes) { 
    $mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'gif' => 'image/gif', 
                'png' => 'image/png', 
    ); 
    return $mimes;
}

From what I understand this will not work for admins or any user with the unfiltered_upload capability. Also have a look at this post Limit image upload to one and disable audio, video and other document file types to upload

An alternative to control size limit would be to use .htaccess or php.ini:

For upload limit you can set in .htaccess one of the following;

LimitRequestBody 1073741824  //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M

For php.ini you can set upload_max_filesize = 1M

deleted 8 characters in body
Source Link
Wyck
  • 18k
  • 4
  • 46
  • 67

You can I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes

The filter:

add_filter('upload_mimes','restict_mime'); 

function restict_mime($mimes) { 
$mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'gif' => 'image/gif', 
                'png' => 'image/png', 
); 

From what I understand this will not work for admins or any user with the unfiltered_upload capability. Also have a look at this post Limit image upload to one and disable audio, video and other document file types to upload

An alternative to control size limit would be to use .htaccess or php.ini:

For upload limit you can set in .htaccess one of the following;

LimitRequestBody 1073741824  //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M

For php.ini you can set upload_max_filesize = 1M

You can I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes

The filter:

add_filter('upload_mimes','restict_mime'); 

function restict_mime($mimes) { 
$mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'gif' => 'image/gif', 
                'png' => 'image/png', 
); 

From what I understand this will not work for admins or any user with the unfiltered_upload capability. Also have a look at this post Limit image upload to one and disable audio, video and other document file types to upload

An alternative to control size limit would be to use .htaccess or php.ini:

For upload limit you can set in .htaccess one of the following;

LimitRequestBody 1073741824  //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M

For php.ini you can set upload_max_filesize = 1M

I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes

The filter:

add_filter('upload_mimes','restict_mime'); 

function restict_mime($mimes) { 
$mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'gif' => 'image/gif', 
                'png' => 'image/png', 
); 

From what I understand this will not work for admins or any user with the unfiltered_upload capability. Also have a look at this post Limit image upload to one and disable audio, video and other document file types to upload

An alternative to control size limit would be to use .htaccess or php.ini:

For upload limit you can set in .htaccess one of the following;

LimitRequestBody 1073741824  //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M

For php.ini you can set upload_max_filesize = 1M

Source Link
Wyck
  • 18k
  • 4
  • 46
  • 67
Loading