Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




media_upload_form [ WordPress Function ]

media_upload_form ( $errors = null )
Parameters:
  • (unknown_type) $errors
Defined at:



{@internal Missing Short Description}}

Source


<?php
function media_upload_form$errors null ) {
    global 
$type$tab$pagenow$is_IE$is_opera;

    if ( ! 
_device_can_upload() ) {
        echo 
'<p>' __('The web browser on your device cannot be used to upload files. You may be able to use the <a href="http://wordpress.org/extend/mobile/">native app for your device</a> instead.') . '</p>';
        return;
    }

    
$upload_action_url admin_url('async-upload.php');
    
$post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
    
$_type = isset($type) ? $type '';
    
$_tab = isset($tab) ? $tab '';

    
$upload_size_unit $max_upload_size wp_max_upload_size();
    
$sizes = array( 'KB''MB''GB' );

    for ( 
$u = -1$upload_size_unit 1024 && $u count$sizes ) - 1$u++ ) {
        
$upload_size_unit /= 1024;
    }

    if ( 
$u ) {
        
$upload_size_unit 0;
        
$u 0;
    } else {
        
$upload_size_unit = (int) $upload_size_unit;
    }
?>

<div id="media-upload-notice"><?php

    
if (isset($errors['upload_notice']) )
        echo 
$errors['upload_notice'];

?></div>
<div id="media-upload-error"><?php

    
if (isset($errors['upload_error']) && is_wp_error($errors['upload_error']))
        echo 
$errors['upload_error']->get_error_message();

?></div>
<?php
// Check quota for this blog if multisite
if ( is_multisite() && !is_upload_space_available() ) {
    echo 
'<p>' sprintf__'Sorry, you have filled your storage quota (%s MB).' ), get_space_allowed() ) . '</p>';
    return;
}
?>

Examples [ wp-snippets.com ]

Top Google Search Results

More ...

User discussions [ wordpress.org ]

0 User Note(s)

None yet. Be the first!

Add New ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics