Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: media_upload_form_url

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 4 times in this file.

Line Code
1418  * @param unknown_type $id
1419  */
1420 function media_upload_type_form($type = 'file', $errors = null, $id = null) {
1421
1422      media_upload_header();
1423
1424      $post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0;
1425
1426      $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
1427      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1428      $form_class = 'media-upload-form type-form validate';
1429
1430      if ( get_user_setting('uploader') )
1431           $form_class .= ' html-uploader';
1432 ?>
1433
1434 <form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
1435 <?php submit_button( '', 'hidden', 'save', false ); ?>
1436 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
 
Line Code
1483 function media_upload_type_url_form($type = null, $errors = null, $id = null) {
1484      if ( null === $type )
1485           $type = 'image';
1486
1487      media_upload_header();
1488
1489      $post_id = intval($_REQUEST['post_id']);
1490
1491      $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
1492      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1493      $form_class = 'media-upload-form type-form validate';
1494
1495      if ( get_user_setting('uploader') )
1496           $form_class .= ' html-uploader';
1497 ?>
1498
1499 <form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
1500 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
1501 <?php wp_nonce_field('media-form'); ?>
 
Line Code
1617  */
1618 function media_upload_gallery_form($errors) {
1619      global $redir_tab, $type;
1620
1621      $redir_tab = 'gallery';
1622      media_upload_header();
1623
1624      $post_id = intval($_REQUEST['post_id']);
1625      $form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id");
1626      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1627      $form_class = 'media-upload-form validate';
1628
1629      if ( get_user_setting('uploader') )
1630           $form_class .= ' html-uploader';
1631 ?>
1632
1633 <script type="text/javascript">
1634 <!--
1635 jQuery(function($){
 
Line Code
1763  */
1764 function media_upload_library_form($errors) {
1765      global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
1766
1767      media_upload_header();
1768
1769      $post_id = intval($_REQUEST['post_id']);
1770
1771      $form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
1772      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1773      $form_class = 'media-upload-form validate';
1774
1775      if ( get_user_setting('uploader') )
1776           $form_class .= ' html-uploader';
1777
1778      $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
1779      if ( $_GET['paged'] < 1 )
1780           $_GET['paged'] = 1;
1781      $start = ( $_GET['paged'] - 1 ) * 10;