WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 4 times in this file.
Line | Code |
---|---|
1889 |
|
1890 | /** |
1891 | * Filter the media upload form action URL. |
1892 | * |
1893 | * @since 2.6.0 |
1894 | * |
1895 | * @param string $form_action_url The media upload form action URL. |
1896 | * @param string $type The type of media. Default 'file'. |
1897 | */ |
1898 | $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); |
1899 | $form_class = 'media-upload-form type-form validate'; |
1900 |
|
1901 | if ( get_user_setting('uploader') ) |
1902 | $form_class .= ' html-uploader'; |
1903 | ?> |
1904 |
|
1905 | <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"> |
1906 | <?php submit_button( '', 'hidden', 'save', false ); ?> |
1907 | <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> |
Line | Code |
1955 | if ( null === $type ) |
1956 | $type = 'image'; |
1957 |
|
1958 | media_upload_header(); |
1959 |
|
1960 | $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; |
1961 |
|
1962 | $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id"); |
1963 | /** This filter is documented in wp-admin/includes/media.php */ |
1964 | $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); |
1965 | $form_class = 'media-upload-form type-form validate'; |
1966 |
|
1967 | if ( get_user_setting('uploader') ) |
1968 | $form_class .= ' html-uploader'; |
1969 | ?> |
1970 |
|
1971 | <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"> |
1972 | <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> |
1973 | <?php wp_nonce_field('media-form'); ?> |
Line | Code |
2097 | function media_upload_gallery_form($errors) { |
2098 | global $redir_tab, $type; |
2099 |
|
2100 | $redir_tab = 'gallery'; |
2101 | media_upload_header(); |
2102 |
|
2103 | $post_id = intval($_REQUEST['post_id']); |
2104 | $form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id"); |
2105 | /** This filter is documented in wp-admin/includes/media.php */ |
2106 | $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); |
2107 | $form_class = 'media-upload-form validate'; |
2108 |
|
2109 | if ( get_user_setting('uploader') ) |
2110 | $form_class .= ' html-uploader'; |
2111 | ?> |
2112 |
|
2113 | <script type="text/javascript"> |
2114 | jQuery(function($){ |
2115 | var preloaded = $(".media-item.preloaded"); |
Line | Code |
2242 | function media_upload_library_form($errors) { |
2243 | global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types; |
2244 |
|
2245 | media_upload_header(); |
2246 |
|
2247 | $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; |
2248 |
|
2249 | $form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id"); |
2250 | /** This filter is documented in wp-admin/includes/media.php */ |
2251 | $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); |
2252 | $form_class = 'media-upload-form validate'; |
2253 |
|
2254 | if ( get_user_setting('uploader') ) |
2255 | $form_class .= ' html-uploader'; |
2256 |
|
2257 | $q = $_GET; |
2258 | $q['posts_per_page'] = 10; |
2259 | $q['paged'] = isset( $q['paged'] ) ? intval( $q['paged'] ) : 0; |
2260 | if ( $q['paged'] < 1 ) { |