Add some actions and filters to the media uploader. Props tellyworth. fixes #6658 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@7652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-04-14 16:32:04 +00:00
parent 030a8b9b33
commit b83563f368
1 changed files with 10 additions and 2 deletions

View File

@ -787,6 +787,9 @@ function media_upload_form( $errors = null ) {
<?php echo $errors['upload_error']->get_error_message(); ?> <?php echo $errors['upload_error']->get_error_message(); ?>
<?php } ?> <?php } ?>
</div> </div>
<?php do_action('pre-upload-ui'); ?>
<?php if ( $flash ) : ?> <?php if ( $flash ) : ?>
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
@ -822,15 +825,17 @@ jQuery(function($){
//--> //-->
</script> </script>
<div id="flash-upload-ui"> <div id="flash-upload-ui">
<?php do_action('pre-flash-upload-ui'); ?>
<p><input id="flash-browse-button" type="button" value="<?php _e('Choose files to upload'); ?>" class="button" /></p> <p><input id="flash-browse-button" type="button" value="<?php _e('Choose files to upload'); ?>" class="button" /></p>
<p><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p> <?php do_action('post-flash-upload-ui'); ?>
<p class="howto"><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
</div> </div>
<?php endif; // $flash ?> <?php endif; // $flash ?>
<div id="html-upload-ui"> <div id="html-upload-ui">
<?php do_action('pre-html-upload-ui'); ?>
<p> <p>
<input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php echo attribute_escape(__('Upload')); ?>" /> <a href="#" onClick="return top.tb_remove();"><?php _e('Cancel'); ?></a> <input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php echo attribute_escape(__('Upload')); ?>" /> <a href="#" onClick="return top.tb_remove();"><?php _e('Cancel'); ?></a>
</p> </p>
@ -839,7 +844,9 @@ jQuery(function($){
<?php if ( is_lighttpd_before_150() ): ?> <?php if ( is_lighttpd_before_150() ): ?>
<p><?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?></p> <p><?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?></p>
<?php endif;?> <?php endif;?>
<?php do_action('post-html-upload-ui'); ?>
</div> </div>
<?php do_action('post-upload-ui'); ?>
<?php <?php
} }
@ -849,6 +856,7 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) {
$post_id = intval($_REQUEST['post_id']); $post_id = intval($_REQUEST['post_id']);
$form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type=$type&tab=type&post_id=$post_id"; $form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type=$type&tab=type&post_id=$post_id";
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
$callback = "type_form_$type"; $callback = "type_form_$type";
?> ?>