upload_space_setting() WordPress Function
This function allows you to change the default upload space for your WordPress site. By default, WordPress sets the maximum upload space to 2MB. However, you can change this setting by using the upload_space_setting() function. This function takes two parameters: the maximum upload space (in megabytes) and the minimum upload space (in megabytes). For example, you can use the following code to change the default upload space to 5MB: upload_space_setting(5); You can also use this function to change the minimum upload space. For example, you can use the following code to change the minimum upload space to 1MB: upload_space_setting(1,5);
upload_space_setting( int $id ) #
Displays the site upload space quota setting form on the Edit Site Settings screen.
Parameters
- $id
(int)(Required)The ID of the site to display the setting for.
Source
File: wp-admin/includes/ms.php
function upload_space_setting( $id ) { switch_to_blog( $id ); $quota = get_option( 'blog_upload_space' ); restore_current_blog(); if ( ! $quota ) { $quota = ''; } ?> <tr> <th><label for="blog-upload-space-number"><?php _e( 'Site Upload Space Quota' ); ?></label></th> <td> <input type="number" step="1" min="0" style="width: 100px" name="option[blog_upload_space]" id="blog-upload-space-number" aria-describedby="blog-upload-space-desc" value="<?php echo $quota; ?>" /> <span id="blog-upload-space-desc"><span class="screen-reader-text"><?php _e( 'Size in megabytes' ); ?></span> <?php _e( 'MB (Leave blank for network default)' ); ?></span> </td> </tr> <?php }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |