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
1640  * @param integer $id
1641  */
1642 function media_upload_type_form($type = 'file', $errors = null, $id = null) {
1643
1644      media_upload_header();
1645
1646      $post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0;
1647
1648      $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
1649      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1650      $form_class = 'media-upload-form type-form validate';
1651
1652      if ( get_user_setting('uploader') )
1653           $form_class .= ' html-uploader';
1654 ?>
1655
1656 <form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
1657 <?php submit_button( '', 'hidden', 'save', false ); ?>
1658 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
 
Line Code
1705 function media_upload_type_url_form($type = null, $errors = null, $id = null) {
1706      if ( null === $type )
1707           $type = 'image';
1708
1709      media_upload_header();
1710
1711      $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
1712
1713      $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
1714      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1715      $form_class = 'media-upload-form type-form validate';
1716
1717      if ( get_user_setting('uploader') )
1718           $form_class .= ' html-uploader';
1719 ?>
1720
1721 <form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
1722 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
1723 <?php wp_nonce_field('media-form'); ?>
 
Line Code
1834  */
1835 function media_upload_gallery_form($errors) {
1836      global $redir_tab, $type;
1837
1838      $redir_tab = 'gallery';
1839      media_upload_header();
1840
1841      $post_id = intval($_REQUEST['post_id']);
1842      $form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id");
1843      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1844      $form_class = 'media-upload-form validate';
1845
1846      if ( get_user_setting('uploader') )
1847           $form_class .= ' html-uploader';
1848 ?>
1849
1850 <script type="text/javascript">
1851 <!--
1852 jQuery(function($){
 
Line Code
1980  */
1981 function media_upload_library_form($errors) {
1982      global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
1983
1984      media_upload_header();
1985
1986      $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
1987
1988      $form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
1989      $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
1990      $form_class = 'media-upload-form validate';
1991
1992      if ( get_user_setting('uploader') )
1993           $form_class .= ' html-uploader';
1994
1995      $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
1996      if ( $_GET['paged'] < 1 )
1997           $_GET['paged'] = 1;
1998      $start = ( $_GET['paged'] - 1 ) * 10;