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
1410
1411      if ( $is_iphone )
1412           return;
1413
1414      media_upload_header();
1415
1416      $post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0;
1417
1418      $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
1419      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1420      $form_class = 'media-upload-form type-form validate';
1421
1422      if ( get_user_setting('uploader') )
1423           $form_class .= ' html-uploader';
1424 ?>
1425
1426 <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">
1427 <?php submit_button( '', 'hidden', 'save', false ); ?>
1428 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
 
Line Code
1475 function media_upload_type_url_form($type = null, $errors = null, $id = null) {
1476      if ( null === $type )
1477           $type = 'image';
1478
1479      media_upload_header();
1480
1481      $post_id = intval($_REQUEST['post_id']);
1482
1483      $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
1484      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1485      $form_class = 'media-upload-form type-form validate';
1486
1487      if ( get_user_setting('uploader') )
1488           $form_class .= ' html-uploader';
1489 ?>
1490
1491 <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">
1492 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
1493 <?php wp_nonce_field('media-form'); ?>
 
Line Code
1603  */
1604 function media_upload_gallery_form($errors) {
1605      global $redir_tab, $type;
1606
1607      $redir_tab = 'gallery';
1608      media_upload_header();
1609
1610      $post_id = intval($_REQUEST['post_id']);
1611      $form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id");
1612      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1613      $form_class = 'media-upload-form validate';
1614
1615      if ( get_user_setting('uploader') )
1616           $form_class .= ' html-uploader';
1617 ?>
1618
1619 <script type="text/javascript">
1620 <!--
1621 jQuery(function($){
 
Line Code
1749  */
1750 function media_upload_library_form($errors) {
1751      global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
1752
1753      media_upload_header();
1754
1755      $post_id = intval($_REQUEST['post_id']);
1756
1757      $form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
1758      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1759      $form_class = 'media-upload-form validate';
1760
1761      if ( get_user_setting('uploader') )
1762           $form_class .= ' html-uploader';
1763
1764      $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
1765      if ( $_GET['paged'] < 1 )
1766           $_GET['paged'] = 1;
1767      $start = ( $_GET['paged'] - 1 ) * 10;