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
1888
1889      /**
1890       * Filter the media upload form action URL.
1891       *
1892       * @since 2.6.0
1893       *
1894       * @param string $form_action_url The media upload form action URL.
1895       * @param string $type            The type of media. Default 'file'.
1896       */
1897      $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
1898      $form_class = 'media-upload-form type-form validate';
1899
1900      if ( get_user_setting('uploader') )
1901           $form_class .= ' html-uploader';
1902 ?>
1903
1904 <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">
1905 <?php submit_button( '', 'hidden', 'save', false ); ?>
1906 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
 
Line Code
1954      if ( null === $type )
1955           $type = 'image';
1956
1957      media_upload_header();
1958
1959      $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
1960
1961      $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
1962      /** This filter is documented in wp-admin/includes/media.php */
1963      $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
1964      $form_class = 'media-upload-form type-form validate';
1965
1966      if ( get_user_setting('uploader') )
1967           $form_class .= ' html-uploader';
1968 ?>
1969
1970 <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">
1971 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
1972 <?php wp_nonce_field('media-form'); ?>
 
Line Code
2096 function media_upload_gallery_form($errors) {
2097      global $redir_tab, $type;
2098
2099      $redir_tab = 'gallery';
2100      media_upload_header();
2101
2102      $post_id = intval($_REQUEST['post_id']);
2103      $form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id");
2104      /** This filter is documented in wp-admin/includes/media.php */
2105      $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
2106      $form_class = 'media-upload-form validate';
2107
2108      if ( get_user_setting('uploader') )
2109           $form_class .= ' html-uploader';
2110 ?>
2111
2112 <script type="text/javascript">
2113 <!--
2114 jQuery(function($){
 
Line Code
2243 function media_upload_library_form($errors) {
2244      global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
2245
2246      media_upload_header();
2247
2248      $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
2249
2250      $form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
2251      /** This filter is documented in wp-admin/includes/media.php */
2252      $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
2253      $form_class = 'media-upload-form validate';
2254
2255      if ( get_user_setting('uploader') )
2256           $form_class .= ' html-uploader';
2257
2258      $q = $_GET;
2259      $q['posts_per_page'] = 10;
2260      $q['paged'] = isset( $q['paged'] ) ? intval( $q['paged'] ) : 0;
2261      if ( $q['paged'] < 1 ) {