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 |
---|---|
1586 | * @param integer $id |
1587 | */ |
1588 | function media_upload_type_form($type = 'file', $errors = null, $id = null) { |
1589 |
|
1590 | media_upload_header(); |
1591 |
|
1592 | $post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0; |
1593 |
|
1594 | $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id"); |
1595 | $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type); |
1596 | $form_class = 'media-upload-form type-form validate'; |
1597 |
|
1598 | if ( get_user_setting('uploader') ) |
1599 | $form_class .= ' html-uploader'; |
1600 | ?> |
1601 |
|
1602 | <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"> |
1603 | <?php submit_button( '', 'hidden', 'save', false ); ?> |
1604 | <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> |
Line | Code |
1651 | function media_upload_type_url_form($type = null, $errors = null, $id = null) { |
1652 | if ( null === $type ) |
1653 | $type = 'image'; |
1654 |
|
1655 | media_upload_header(); |
1656 |
|
1657 | $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; |
1658 |
|
1659 | $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id"); |
1660 | $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type); |
1661 | $form_class = 'media-upload-form type-form validate'; |
1662 |
|
1663 | if ( get_user_setting('uploader') ) |
1664 | $form_class .= ' html-uploader'; |
1665 | ?> |
1666 |
|
1667 | <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"> |
1668 | <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> |
1669 | <?php wp_nonce_field('media-form'); ?> |
Line | Code |
1780 | */ |
1781 | function media_upload_gallery_form($errors) { |
1782 | global $redir_tab, $type; |
1783 |
|
1784 | $redir_tab = 'gallery'; |
1785 | media_upload_header(); |
1786 |
|
1787 | $post_id = intval($_REQUEST['post_id']); |
1788 | $form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id"); |
1789 | $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type); |
1790 | $form_class = 'media-upload-form validate'; |
1791 |
|
1792 | if ( get_user_setting('uploader') ) |
1793 | $form_class .= ' html-uploader'; |
1794 | ?> |
1795 |
|
1796 | <script type="text/javascript"> |
1797 | <!-- |
1798 | jQuery(function($){ |
Line | Code |
1926 | */ |
1927 | function media_upload_library_form($errors) { |
1928 | global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types; |
1929 |
|
1930 | media_upload_header(); |
1931 |
|
1932 | $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; |
1933 |
|
1934 | $form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id"); |
1935 | $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type); |
1936 | $form_class = 'media-upload-form validate'; |
1937 |
|
1938 | if ( get_user_setting('uploader') ) |
1939 | $form_class .= ' html-uploader'; |
1940 |
|
1941 | $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0; |
1942 | if ( $_GET['paged'] < 1 ) |
1943 | $_GET['paged'] = 1; |
1944 | $start = ( $_GET['paged'] - 1 ) * 10; |