Advertisements

wp_dashboard_quota

Definition:
function wp_dashboard_quota() {}

Source code

function wp_dashboard_quota() {

	if ( !is_multisite() || !current_user_can('upload_files') || get_site_option( 'upload_space_check_disabled' ) )

		return true;



	$quota = get_space_allowed();

	$used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024;



	if ( $used > $quota )

		$percentused = '100';

	else

		$percentused = ( $used / $quota ) * 100;

	$used_color = ( $percentused >= 70 ) ? ' spam' : '';

	$used = round( $used, 2 );

	$percentused = number_format( $percentused );



	?>

	<p class="sub musub"><?php _e( 'Storage Space' ); ?></p>

	<div class="table table_content musubtable">

	<table>

		<tr class="first">

			<td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), esc_url( admin_url( 'upload.php' ) ), $quota ); ?></td>

			<td class="t posts"><?php _e( 'Space Allowed' ); ?></td>

		</tr>

	</table>

	</div>

	<div class="table table_discussion musubtable">

	<table>

		<tr class="first">

			<td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), esc_url( admin_url( 'upload.php' ) ), $used, $percentused ); ?></td>

			<td class="last t comments<?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>

		</tr>

	</table>

	</div>

	<br class="clear" />

	<?php

}

10673

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: