Make WordPress Core

Ticket #21179: 21179.patch

File 21179.patch, 1.1 KB (added by dllh, 12 years ago)
  • wp-admin/includes/media.php

     
    13261326
    13271327?></div>
    13281328<?php
    1329 // Check quota for this blog if multisite
    1330 if ( is_multisite() && !is_upload_space_available() ) {
    1331         echo '<p>' . sprintf( __( 'Sorry, you have filled your storage quota (%s MB).' ), get_space_allowed() ) . '</p>';
    1332         return;
    1333 }
    13341329
    13351330do_action('pre-upload-ui');
     1331if ( true === apply_filters( 'suppress-upload-ui', false ) )
     1332        return;
    13361333
    13371334$post_params = array(
    13381335                "post_id" => $post_id,
     
    20652062}
    20662063add_action('post-plupload-upload-ui', 'media_upload_flash_bypass');
    20672064
     2065function multisite_quota_check() {
     2066        // Check quota for this blog if multisite
     2067        if ( is_multisite() && !is_upload_space_available() ) {
     2068                add_filter( 'suppress-upload-ui', '__return_true' );
     2069                echo '<p>' . sprintf( __( 'Sorry, you have filled your storage quota (%s MB).' ), get_space_allowed() ) . '</p>';
     2070        }
     2071}
     2072add_action( 'pre-upload-ui', 'multisite_quota_check', 9 );
     2073
    20682074/**
    20692075 * {@internal Missing Short Description}}
    20702076 *