Switch language

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




wp_import_upload_form [ WordPress Function ]

wp_import_upload_form ( $action )
Parameters:
  • (string) $action The action attribute for the form.
Defined at:



Outputs the form used by the importers to accept the data to be imported

Source


<?php
function wp_import_upload_form$action ) {
    
$bytes apply_filters'import_upload_size_limit'wp_max_upload_size() );
    
$size wp_convert_bytes_to_hr$bytes );
    
$upload_dir wp_upload_dir();
    if ( ! empty( 
$upload_dir['error'] ) ) :
        
?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
        <p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php
    
else :
?>
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action'import-upload')); ?>">
<p>
<label for="upload"><?php _e'Choose a file from your computer:' ); ?></label> (<?php printf__('Maximum size: %s' ), $size ); ?>)
<input type="file" id="upload" name="import" size="25" />
<input type="hidden" name="action" value="save" />
<input type="hidden" name="max_file_size" value="<?php echo $bytes?>" />
</p>
<?php submit_button__('Upload file and import'), 'button' ); ?>
</form>
<?php
    
endif;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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