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