Make WordPress Core

Ticket #25375: 25375.5.diff

File 25375.5.diff, 21.5 KB (added by kpdesign, 12 years ago)

Fixed duplicate hook format, minor docblock changes

  • src/wp-admin/includes/media.php

     
    2121                'library' => __('Media Library')
    2222        );
    2323
    24         return apply_filters('media_upload_tabs', $_default_tabs);
     24        /**
     25         * Filter the available tabs in the legacy (pre-3.5.0) media popup.
     26         *
     27         * @since 2.5.0
     28         *
     29         * @param array $_default_tabs An array of media tabs in the form of key/value pairs.
     30         */
     31        return apply_filters( 'media_upload_tabs', $_default_tabs );
    2532}
    2633
    2734/**
     
    7380                elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) )
    7481                        $current = $_GET['tab'];
    7582                else
    76                         $current = apply_filters('media_upload_default_tab', $default);
     83                        /**
     84                         * Filter the default tab in the legacy (pre-3.5.0) media popup.
     85                         *
     86                         * @since 2.5.0
     87                         *
     88                         * @param string $default The default media popup tab.
     89                         */
     90                        $current = apply_filters( 'media_upload_default_tab', $default );
    7791
    7892                foreach ( $tabs as $callback => $text ) {
    7993                        $class = '';
     
    113127        if ( $url )
    114128                $html = '<a href="' . esc_attr($url) . "\"$rel>$html</a>";
    115129
     130        /**
     131         * Filter the image HTML markup to send to the editor.
     132         *
     133         * @since 2.5.0
     134         *
     135         * @param string $html    The image HTML markup to send.
     136         * @param int    $id      The attachment id.
     137         * @param string $caption The image caption.
     138         * @param string $title   The image title.
     139         * @param string $align   The image alignment.
     140         * @param string $url     The image source URL.
     141         * @param string $size    The image size.
     142         * @param string $alt     The image alternative, or alt, text.
     143         */
    116144        $html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt );
    117145
    118146        return $html;
     
    135163 */
    136164function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {
    137165
     166        /**
     167         * Filter whether to disable captions.
     168         *
     169         * Prevents image captions from being appended to image HTML when inserted into the editor.
     170         *
     171         * @since 2.7.0
     172         *
     173         * @param bool $bool Whether to disable appending captions. Returning true to the filter
     174         *                   will disable captions. Default empty string.
     175         */
    138176        if ( empty($caption) || apply_filters( 'disable_captions', '' ) )
    139177                return $html;
    140178
     
    156194
    157195        $shcode = '[caption id="' . $id . '" align="align' . $align     . '" width="' . $width . '"]' . $html . ' ' . $caption . '[/caption]';
    158196
     197        /**
     198         * Filter the image HTML markup including the caption shortcode.
     199         *
     200         * @since 2.6.0
     201         *
     202         * @param string $shcode The image HTML markup with caption shortcode.
     203         * @param string $html   The image HTML markup.
     204         */
    159205        return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
    160206}
    161207add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 );
     
    397443//]]>
    398444</script>
    399445<?php
    400 do_action('admin_enqueue_scripts', 'media-upload-popup');
    401 do_action('admin_print_styles-media-upload-popup');
    402 do_action('admin_print_styles');
    403 do_action('admin_print_scripts-media-upload-popup');
    404 do_action('admin_print_scripts');
    405 do_action('admin_head-media-upload-popup');
    406 do_action('admin_head');
     446        /** This action is documented in wp-admin/admin-header.php */
     447        do_action( 'admin_enqueue_scripts', 'media-upload-popup' );
    407448
     449        /**
     450         * Prints styles enqueued for the legacy (pre-3.5.0) media upload popup.
     451         *
     452         * @since 2.9.0
     453         * @since 3.5.0
     454         */
     455        do_action( 'admin_print_styles-media-upload-popup' );
     456
     457        /** This action is documented in wp-admin/admin-header.php */
     458        do_action( 'admin_print_styles' );
     459
     460        /**
     461         * Prints scripts enqueued for the legacy (pre-3.5.0) media upload popup.
     462         *
     463         * @since 2.9.0
     464         * @since 3.5.0
     465         */
     466        do_action( 'admin_print_scripts-media-upload-popup' );
     467
     468        /** This action is documented in wp-admin/admin-header.php */
     469        do_action( 'admin_print_scripts' );
     470
     471        /**
     472         * Prints scripts enqueued for the admin header for the legacy (pre-3.5.0) media upload popup.
     473         *
     474         * @since 2.9.0
     475         * @since 3.5.0
     476         */
     477        do_action( 'admin_head-media-upload-popup' );
     478
     479        /** This action is documented in wp-admin/admin-header.php */
     480        do_action( 'admin_head' );
     481
    408482if ( is_string($content_func) )
    409         do_action( "admin_head_{$content_func}" );
     483        /**
     484         * Fires in the admin header for specific media upload type forms.
     485         *
     486         * Part of the legacy (pre-3.5.0) media upload popup.
     487         *
     488         * The dynamic portion of the hook, $content_func, refers to the media
     489         * upload type form callback.
     490         *
     491         * @since 2.5.0
     492         */
     493do_action( "admin_head_{$content_func}" );
    410494?>
    411495</head>
    412496<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-core-ui no-js">
     
    418502        $args = array_slice($args, 1);
    419503        call_user_func_array($content_func, $args);
    420504
    421         do_action('admin_print_footer_scripts');
     505        /** This action is documented in wp-admin/admin-footer.php */
     506        do_action( 'admin_print_footer_scripts' );
    422507?>
    423508<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
    424509</body>
     
    446531
    447532        echo '<a href="#" id="insert-media-button" class="button insert-media add_media" data-editor="' . esc_attr( $editor_id ) . '" title="' . esc_attr__( 'Add Media' ) . '">' . $img . __( 'Add Media' ) . '</a>';
    448533
    449         // Don't use this filter. Want to add a button? Use the media_buttons action.
    450         $legacy_filter = apply_filters('media_buttons_context', ''); // deprecated
     534        /**
     535         * Filter the legacy (pre-3.5.0) media buttons.
     536         *
     537         * @since 2.5.0
     538         * @deprecated 3.5.0 Use 'media_buttons' action instead.
     539         *
     540         * @param string $string Media buttons context.
     541         */
     542        $legacy_filter = apply_filters( 'media_buttons_context', '' );
    451543
    452544        if ( $legacy_filter ) {
    453545                // #WP22559. Close <a> if a plugin started by closing <a> to open their own <a> tag.
     
    472564        if ( ! empty( $tab ) )
    473565                $upload_iframe_src = add_query_arg('tab', $tab, $upload_iframe_src);
    474566
    475         $upload_iframe_src = apply_filters($type . '_upload_iframe_src', $upload_iframe_src);
     567        /**
     568         * Filter the upload iframe source URL by media type.
     569         *
     570         * The dynamic portion of the hook name, $type, refers to the type of media uploaded.
     571         *
     572         * @since 3.0.0
     573         *
     574         * @param string $upload_iframe_src The upload iframe source URL by type.
     575         */
     576        $upload_iframe_src = apply_filters( "{$type}_upload_iframe_src", $upload_iframe_src );
    476577
    477578        return add_query_arg('TB_iframe', true, $upload_iframe_src);
    478579}
     
    514615                                $post['post_parent'] = $attachment['post_parent'];
    515616                }
    516617
    517                 $post = apply_filters('attachment_fields_to_save', $post, $attachment);
     618                /**
     619                 * Filter the attachment fields to be saved.
     620                 *
     621                 * @since 2.5.0
     622                 *
     623                 * @param WP_Post $post       The WP_Post object.
     624                 * @param array   $attachment An array of attachment metadata.
     625                 */
     626                $post = apply_filters( 'attachment_fields_to_save', $post, $attachment );
    518627
    519628                if ( isset($attachment['image_alt']) ) {
    520629                        $image_alt = wp_unslash( $attachment['image_alt'] );
     
    561670                        $html = "<a href='{$attachment['url']}'$rel>$html</a>";
    562671                }
    563672
    564                 $html = apply_filters('media_send_to_editor', $html, $send_id, $attachment);
     673                /**
     674                 * Filter the media HTML markup sent to the editor.
     675                 *
     676                 * @since 2.5.0
     677                 *
     678                 * @param string $html       The media's HTML markup sent to the editor.
     679                 * @param int    $send_id    The first key from the $_POST['send'] data.
     680                 * @param array  $attachment The attachment metadata.
     681                 */
     682                $html = apply_filters( 'media_send_to_editor', $html, $send_id, $attachment );
    565683                return media_send_to_editor($html);
    566684        }
    567685
     
    608726                                && ( 'audio' == $ext_type || 'video' == $ext_type ) )
    609727                                        $type = $ext_type;
    610728
    611                         $html = apply_filters( $type . '_send_to_editor_url', $html, esc_url_raw( $src ), $title );
     729                        /**
     730                         * Filter the media URL sent to the editor by type.
     731                         *
     732                         * The dynamic portion of the hook name, $type, refers to the type of media being sent.
     733                         *
     734                         * @since 3.3.0
     735                         *
     736                         * @param string $html  The HTML markup sent to the editor.
     737                         * @param string $src   The media source URL.
     738                         * @param string $title The media title.
     739                         */
     740                        $html = apply_filters( "{$type}_send_to_editor_url", $html, esc_url_raw( $src ), $title );
    612741                } else {
    613742                        $align = '';
    614743                        $alt = esc_attr( wp_unslash( $_POST['alt'] ) );
     
    619748                        if ( !empty($src) )
    620749                                $html = "<img src='" . esc_url($src) . "' alt='$alt'$class />";
    621750
     751                        /**
     752                         * Filter the image URL sent to the editor.
     753                         *
     754                         * @since 2.8.0
     755                         *
     756                         * @param string $html  The HTML markup sent to the editor.
     757                         * @param string $src   The image source URL.
     758                         * @param string $alt   The image alternate, or alt, text.
     759                         * @param string $align The image alignment. Default 'alignnone'.
     760                         *                      Accepts 'alignleft', 'aligncenter', 'alignright', 'alignnone'.
     761                         */
    622762                        $html = apply_filters( 'image_send_to_editor_url', $html, esc_url_raw( $src ), $alt, $align );
    623763                }
    624764
     
    779919function image_size_input_fields( $post, $check = '' ) {
    780920
    781921                // get a list of the actual pixel dimensions of each possible intermediate version of this image
    782                 $size_names = apply_filters( 'image_size_names_choose', array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size')) );
     922                $size_names = array(
     923                        'thumbnail' => __( 'Thumbnail' ),
     924                        'medium'    => __( 'Medium' ),
     925                        'large'     => __( 'Large' ),
     926                        'full'      => __( 'Full Size' )
     927                );
    783928
     929                /**
     930                 * Filter the names of the default image sizes.
     931                 *
     932                 * @since 3.3.0
     933                 *
     934                 * @param array $size_names An array of image sizes and their names.
     935                 *                          Default 'Thumbnail', 'Medium', 'Large', 'Full Size'.
     936                 */
     937                $size_names = apply_filters( 'image_size_names_choose', $size_names );
     938
    784939                if ( empty($check) )
    785940                        $check = get_user_setting('imgsize', 'medium');
    786941
     
    10611216                unset( $form_fields['image_alt'] );
    10621217        }
    10631218
    1064         $form_fields = apply_filters('attachment_fields_to_edit', $form_fields, $post);
     1219        /**
     1220         * Filter the attachment fields to edit.
     1221         *
     1222         * @since 2.5.0
     1223         *
     1224         * @param array   $form_fields An array of attachment form fields.
     1225         * @param WP_Post $post        The WP_Post attachment object.
     1226         */
     1227        $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
    10651228
    10661229        return $form_fields;
    10671230}
     
    11261289
    11271290        $default_args = array( 'errors' => null, 'send' => $current_post_id ? post_type_supports( get_post_type( $current_post_id ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true );
    11281291        $args = wp_parse_args( $args, $default_args );
     1292
     1293        /**
     1294         * Filter the arguments used to retrieve an image for the edit image form.
     1295         *
     1296         * @since 3.1.0
     1297         *
     1298         * @param array $args An array of arguments. @see get_media_item()
     1299         */
    11291300        $args = apply_filters( 'get_media_item_args', $args );
    11301301        extract( $args, EXTR_SKIP );
    11311302
     
    11801351        $meta = wp_get_attachment_metadata( $post->ID );
    11811352        if ( isset( $meta['width'], $meta['height'] ) )
    11821353                $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> ";
     1354
     1355        /**
     1356         * Filter the media metadata.
     1357         *
     1358         * @since 2.5.0
     1359         *
     1360         * @param string  $media_dims The HTML markup containing the media dimensions.
     1361         * @param WP_Post $post       The WP_Post attachment object.
     1362         */
    11831363        $media_dims = apply_filters( 'media_meta', $media_dims, $post );
    11841364
    11851365        $image_edit_button = '';
     
    13431523        $user_can_edit = current_user_can( 'edit_post', $attachment_id );
    13441524
    13451525        $args = wp_parse_args( $args, $default_args );
     1526
     1527        /** This filter documented in wp-admin/includes/media.php */
    13461528        $args = apply_filters( 'get_media_item_args', $args );
    13471529
    13481530        $form_fields = array();
     
    13761558        // The recursive merge is easily traversed with array casting: foreach( (array) $things as $thing )
    13771559        $form_fields = array_merge_recursive($form_fields, (array) $args['errors'] );
    13781560
     1561        /** This filter documented in wp-admin/includes/media.php */
    13791562        $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
    13801563
    13811564        unset( $form_fields['image-size'], $form_fields['align'], $form_fields['image_alt'],
     
    13821565                $form_fields['post_title'], $form_fields['post_excerpt'], $form_fields['post_content'],
    13831566                $form_fields['url'], $form_fields['menu_order'], $form_fields['image_url'] );
    13841567
     1568        /** This filter documented in wp-admin/includes/media.php */
    13851569        $media_meta = apply_filters( 'media_meta', '', $post );
    13861570
    13871571        $defaults = array(
     
    15411725?></div>
    15421726<?php
    15431727if ( is_multisite() && !is_upload_space_available() ) {
     1728        /**
     1729         * Fires when an upload will exceed the defined network site upload space quota.
     1730         *
     1731         * @since 3.5.0
     1732         */
    15441733        do_action( 'upload_ui_over_quota' );
    15451734        return;
    15461735}
    15471736
    1548 do_action('pre-upload-ui');
     1737/**
     1738 * Fires just before the legacy (pre-3.5.0) upload interface is loaded.
     1739 *
     1740 * @since 2.6.0
     1741 */
     1742do_action( 'pre-upload-ui' );
    15491743
    15501744$post_params = array(
    15511745                "post_id" => $post_id,
     
    15551749                "short" => "1",
    15561750);
    15571751
    1558 $post_params = apply_filters( 'upload_post_params', $post_params ); // hook change! old name: 'swfupload_post_params'
     1752/**
     1753 * Filter the media upload post parameters.
     1754 *
     1755 * Previously named 'swfupload_post_params'.
     1756 *
     1757 * @since 3.3.0
     1758 * @since 3.5.0
     1759 *
     1760 * @param array $post_params An array of media upload parameters used by Plupload.
     1761 */
     1762$post_params = apply_filters( 'upload_post_params', $post_params );
    15591763
    15601764$plupload_init = array(
    15611765        'runtimes' => 'html5,silverlight,flash,html4',
     
    15791783if ( wp_is_mobile() )
    15801784        $plupload_init['multi_selection'] = false;
    15811785
     1786/**
     1787 * Filter the default Plupload settings.
     1788 *
     1789 * @since 3.3.0
     1790 *
     1791 * @param array $plupload_init An array of default settings used by Plupload.
     1792 */
    15821793$plupload_init = apply_filters( 'plupload_init', $plupload_init );
    15831794
    15841795?>
     
    15981809</script>
    15991810
    16001811<div id="plupload-upload-ui" class="hide-if-no-js">
    1601 <?php do_action('pre-plupload-upload-ui'); // hook change, old name: 'pre-flash-upload-ui' ?>
     1812<?php
     1813/**
     1814 * Fires before the upload interface loads.
     1815 *
     1816 * Previously named 'pre-flash-upload-ui'.
     1817 *
     1818 * @since 3.3.0
     1819 * @since 3.5.0
     1820 */
     1821do_action( 'pre-plupload-upload-ui' ); ?>
    16021822<div id="drag-drop-area">
    16031823        <div class="drag-drop-inside">
    16041824        <p class="drag-drop-info"><?php _e('Drop files here'); ?></p>
     
    16061826        <p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
    16071827        </div>
    16081828</div>
    1609 <?php do_action('post-plupload-upload-ui'); // hook change, old name: 'post-flash-upload-ui' ?>
     1829<?php
     1830/**
     1831 * Fires after the upload interface loads.
     1832 *
     1833 * Previously named 'post-flash-upload-ui'.
     1834 *
     1835 * @since 3.3.0
     1836 * @since 3.5.0
     1837 */
     1838do_action( 'post-plupload-upload-ui' ); ?>
    16101839</div>
    16111840
    16121841<div id="html-upload-ui" class="hide-if-js">
    1613 <?php do_action('pre-html-upload-ui'); ?>
     1842        <?php
     1843        /**
     1844         * Fires before the upload button in the media upload interface.
     1845         *
     1846         * @since 2.6.0
     1847         */
     1848        do_action( 'pre-html-upload-ui' );
     1849        ?>
    16141850        <p id="async-upload-wrap">
    16151851                <label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label>
    16161852                <input type="file" name="async-upload" id="async-upload" />
     
    16181854                <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
    16191855        </p>
    16201856        <div class="clear"></div>
    1621 <?php do_action('post-html-upload-ui'); ?>
     1857<?php
     1858/**
     1859 * Fires after the upload button in the media upload interface.
     1860 *
     1861 * @since 2.6.0
     1862 */
     1863do_action( 'post-html-upload-ui' );
     1864?>
    16221865</div>
    16231866
    16241867<span class="max-upload-size"><?php printf( __( 'Maximum upload file size: %d%s.' ), esc_html($upload_size_unit), esc_html($sizes[$u]) ); ?></span>
     
    16271870        <span class="big-file-warning"><?php _e('Your browser has some limitations uploading large files with the multi-file uploader. Please use the browser uploader for files over 100MB.'); ?></span>
    16281871<?php }
    16291872
    1630         do_action('post-upload-ui');
     1873        /**
     1874         * Fires on the post upload UI screen.
     1875         *
     1876         * Legacy (pre-3.5.0) media workflow hook.
     1877         *
     1878         * @since 2.6.0
     1879         * @since 3.5.0
     1880         */
     1881        do_action( 'post-upload-ui' );
    16311882}
    16321883
    16331884/**
     
    16461897        $post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0;
    16471898
    16481899        $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);
     1900
     1901        /**
     1902         * Filter the media upload form action URL.
     1903         *
     1904         * @since 2.6.0
     1905         *
     1906         * @param string $form_action_url The media upload form action URL.
     1907         * @param string $type            The type of media. Default 'file'.
     1908         */
     1909        $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
    16501910        $form_class = 'media-upload-form type-form validate';
    16511911
    16521912        if ( get_user_setting('uploader') )
     
    17111971        $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
    17121972
    17131973        $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);
     1974        /** This filter documented in wp-admin/includes/media.php */
     1975        $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
    17151976        $form_class = 'media-upload-form type-form validate';
    17161977
    17171978        if ( get_user_setting('uploader') )
     
    17412002                if ( f.alt.value )
    17422003                        alt = f.alt.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
    17432004
    1744 <?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
     2005<?php
     2006        /** This filter documented in wp-admin/includes/media.php */
     2007        if ( ! apply_filters( 'disable_captions', '' ) ) {
     2008                ?>
    17452009                if ( f.caption.value ) {
    17462010                        caption = f.caption.value.replace(/\r\n|\r/g, '\n');
    17472011                        caption = caption.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(a){
     
    18182082
    18192083<div id="media-items">
    18202084<div class="media-item media-blank">
    1821 <?php echo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) ); ?>
     2085<?php
     2086$form_html = wp_media_insert_url_form( $type );
     2087/**
     2088 * Filter the insert from URL form HTML.
     2089 *
     2090 * @since 3.3.0
     2091 *
     2092 * @param string $form_html The insert from URL form HTML.
     2093 */
     2094echo apply_filters( 'type_url_form_media', $form_html );
     2095?>
    18222096</div>
    18232097</div>
    18242098</form>
     
    18402114
    18412115        $post_id = intval($_REQUEST['post_id']);
    18422116        $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);
     2117        /** This filter documented in wp-admin/includes/media.php */
     2118        $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
    18442119        $form_class = 'media-upload-form validate';
    18452120
    18462121        if ( get_user_setting('uploader') )
     
    19862261        $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
    19872262
    19882263        $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);
     2264        /** This filter documented in wp-admin/includes/media.php */
     2265        $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
    19902266        $form_class = 'media-upload-form validate';
    19912267
    19922268        if ( get_user_setting('uploader') )
     
    20492325
    20502326        $type_links[] = "<li><a href='" . esc_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . "'$class>" . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';
    20512327}
     2328/**
     2329 * Filter the media upload mime type list items.
     2330 *
     2331 * @since 3.1.0
     2332 *
     2333 * @param array $type_links An array of list items containing mime type link HTML.
     2334 */
    20522335echo implode(' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>';
    20532336unset($type_links);
    20542337?>
     
    21482431 * @return string the form html
    21492432 */
    21502433function wp_media_insert_url_form( $default_view = 'image' ) {
     2434        /** This filter documented in wp-admin/includes/media.php */
    21512435        if ( !apply_filters( 'disable_captions', '' ) ) {
    21522436                $caption = '
    21532437                <tr class="image-only">
     
    24302714        $meta = wp_get_attachment_metadata( $post->ID );
    24312715        if ( isset( $meta['width'], $meta['height'] ) )
    24322716                $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> ";
     2717        /** This filter documented in wp-admin/includes/media.php */
    24332718        $media_dims = apply_filters( 'media_meta', $media_dims, $post );
    24342719
    24352720        $att_url = wp_get_attachment_url( $post->ID );
     
    24692754        if ( preg_match( '#^(audio|video)#', $post->post_mime_type ) ):
    24702755
    24712756                /**
    2472                  * Audio and video metadata fields to be shown in the publish meta box.
     2757                 * Filter the audio and video metadata fields to be shown in the publish meta box.
    24732758                 *
    24742759                 * The key for each item in the array should correspond to an attachment
    24752760                 * metadata key, and the value should be the desired label.
    24762761                 *
    2477                  * @since  3.7.0
     2762                 * @since 3.7.0
    24782763                 *
    24792764                 * @param array $fields {
    24802765                 *     An array of the attachment metadata keys and labels.
     
    25152800                endif;
    25162801
    25172802                /**
    2518                  * Audio attachment metadata fields to be shown in the publish meta box.
     2803                 * Filter the audio attachment metadata fields to be shown in the publish meta box.
    25192804                 *
    25202805                 * The key for each item in the array should correspond to an attachment
    25212806                 * metadata key, and the value should be the desired label.
    25222807                 *
    2523                  * @since  3.7.0
     2808                 * @since 3.7.0
    25242809                 *
    25252810                 * @param array $fields {
    25262811                 *     An array of the attachment metadata keys and labels.