Browse files

README: Added note about how to make uplaod settings more permissive.

  • Loading branch information...
1 parent 34c77a6 commit 1d6f165433e431af28f7295a7a00f576cacf6305 @scottgonzalez committed May 21, 2013
Showing with 33 additions and 0 deletions.
  1. +33 −0 README.md
View
33 README.md
@@ -16,6 +16,8 @@ grunt.loadNpmTasks( "grunt-wordpress" );
Finally, copy `grunt-wordpress.js` in to your WordPress install as a plugin.
+If you have problems uploading resources, check the [Permissive Uploads](#permissive-uploads) section.
+
## API
For most projects, you should only need to specify the `wordpress` config
@@ -330,6 +332,37 @@ Synchronizes all resources in `path` to the WordPRess site.
* `path`: The directory containing resources to synchronize.
* `callback` (`function( error )`): Callback to invoke after synchronizing all resources.
+## Permissive Uploads
+
+Depending on what resources you're uploading, you may need to change some WordPress settings.
+Here are a few settings that might help:
+
+```php
+
+// Disable more restrictive multisite upload settings.
+remove_filter( 'upload_mimes', 'check_upload_mimes' );
+
+// Give unfiltered upload ability to super admins.
+define( 'ALLOW_UNFILTERED_UPLOADS', true );
+
+// Allow additional file types.
+add_filter( 'upload_mimes', function( $mimes ) {
+ $mimes[ 'eot' ] = 'application/vnd.ms-fontobject';
+ $mimes[ 'svg' ] = 'image/svg+xml';
+ $mimes[ 'ttf' ] = 'application/x-font-ttf';
+ $mimes[ 'woff' ] = 'application/font-woff';
+ $mimes[ 'xml' ] = 'text/xml';
+ $mimes[ 'php' ] = 'application/x-php';
+ $mimes[ 'json' ] = 'application/json';
+ return $mimes;
+});
+
+// Increase file size limit to 1GB.
+add_filter( 'pre_site_option_fileupload_maxk', function() {
+ return 1024 * 1024;
+});
+```
+
## License
Copyright 2012 Scott González
Licensed under the MIT license.

0 comments on commit 1d6f165

Please sign in to comment.