WordPress.org

Make WordPress Core

Ticket #36206: 36206.2.patch

File 36206.2.patch, 3.5 KB (added by SergeyBiryukov, 2 years ago)
  • src/wp-admin/includes/media.php

     
    28942894                endif;
    28952895
    28962896        if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
     2897                $fields = array(
     2898                        'length_formatted' => __( 'Length:' ),
     2899                        'bitrate'          => __( 'Bitrate:' ),
     2900                );
    28972901
    28982902                /**
    28992903                 * Filters the audio and video metadata fields to be shown in the publish meta box.
     
    29022906                 * metadata key, and the value should be the desired label.
    29032907                 *
    29042908                 * @since 3.7.0
     2909                 * @since 4.8.0 Added the `$post` parameter.
    29052910                 *
    2906                  * @param array $fields An array of the attachment metadata keys and labels.
     2911                 * @param array   $fields An array of the attachment metadata keys and labels.
     2912                 * @param WP_Post $post   WP_Post object for the current attachment.
    29072913                 */
    2908                 $fields = apply_filters( 'media_submitbox_misc_sections', array(
    2909                         'length_formatted' => __( 'Length:' ),
    2910                         'bitrate'          => __( 'Bitrate:' ),
    2911                 ) );
     2914                $fields = apply_filters( 'media_submitbox_misc_sections', $fields, $post );
    29122915
    29132916                foreach ( $fields as $key => $label ) {
    29142917                        if ( empty( $meta[ $key ] ) ) {
     
    29332936        <?php
    29342937                }
    29352938
     2939                $fields = array(
     2940                        'dataformat' => __( 'Audio Format:' ),
     2941                        'codec'      => __( 'Audio Codec:' )
     2942                );
     2943
    29362944                /**
    29372945                 * Filters the audio attachment metadata fields to be shown in the publish meta box.
    29382946                 *
     
    29402948                 * metadata key, and the value should be the desired label.
    29412949                 *
    29422950                 * @since 3.7.0
     2951                 * @since 4.8.0 Added the `$post` parameter.
    29432952                 *
    2944                  * @param array $fields An array of the attachment metadata keys and labels.
     2953                 * @param array   $fields An array of the attachment metadata keys and labels.
     2954                 * @param WP_Post $post   WP_Post object for the current attachment.
    29452955                 */
    2946                 $audio_fields = apply_filters( 'audio_submitbox_misc_sections', array(
    2947                         'dataformat' => __( 'Audio Format:' ),
    2948                         'codec'      => __( 'Audio Codec:' )
    2949                 ) );
     2956                $audio_fields = apply_filters( 'audio_submitbox_misc_sections', $fields, $post );
    29502957
    29512958                foreach ( $audio_fields as $key => $label ) {
    29522959                        if ( empty( $meta['audio'][ $key ] ) ) {
  • src/wp-admin/includes/meta-boxes.php

     
    238238 * Fires at the beginning of the publishing actions section of the Publish meta box.
    239239 *
    240240 * @since 2.7.0
     241 * @since 4.8.0 Added the `$post` parameter.
     242 *
     243 * @param WP_Post|object $post WP_Post object for the current post on Edit Post screen,
     244 *                             or link object for the current link on Edit Link screen.
    241245 */
    242 do_action( 'post_submitbox_start' );
     246do_action( 'post_submitbox_start', $post );
    243247?>
    244248<div id="delete-action">
    245249<?php
     
    320324         * in the attachment editing screen.
    321325         *
    322326         * @since 3.5.0
     327         * @since 4.8.0 Added the `$post` parameter.
     328         *
     329         * @param WP_Post $post WP_Post object for the current post.
    323330         */
    324         do_action( 'attachment_submitbox_misc_actions' );
     331        do_action( 'attachment_submitbox_misc_actions', $post );
    325332        ?>
    326333</div><!-- #misc-publishing-actions -->
    327334<div class="clear"></div>
     
    908915<div id="major-publishing-actions">
    909916<?php
    910917/** This action is documented in wp-admin/includes/meta-boxes.php */
    911 do_action( 'post_submitbox_start' );
     918do_action( 'post_submitbox_start', $link );
    912919?>
    913920<div id="delete-action">
    914921<?php