Make WordPress Core

Ticket #48009: 48009.diff

File 48009.diff, 1.6 KB (added by donmhico, 5 years ago)
  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index 6a073ffd57..94c1831277 100644
    function wp_media_personal_data_exporter( $email_address, $page = 1 ) { 
    43464346                                ),
    43474347                        );
    43484348
     4349                        $attachment_data = wp_prepare_attachment_for_js( $post->ID );
     4350                        if ( $attachment_data ) {
     4351                                $data_to_extract = array(
     4352                                        'filename'              => __( 'File name' ),
     4353                                        'mime'                  => __( 'File type' ),
     4354                                        'dateFormatted'         => __( 'Uploaded on' ),
     4355                                        'filesizeHumanReadable' => __( 'File size' ),
     4356                                        'dimensions'            => __( 'Dimensions' ),
     4357                                        'alt'                   => __( 'Alt text' ),
     4358                                        'title'                 => __( 'Title' ),
     4359                                        'caption'               => __( 'Caption' ),
     4360                                        'description'           => __( 'Description' ),
     4361                                );
     4362
     4363                                foreach ( $data_to_extract as $extract_key => $label ) {
     4364                                        if ( 'dimensions' === $extract_key ) {
     4365                                                if ( 'image' === $attachment_data[ 'type' ] && ( $attachment_data['width'] && $attachment_data['height'] ) ) {
     4366                                                        $post_data_to_export[] = array(
     4367                                                                'name'  => 'Dimensions',
     4368                                                                'value' => sprintf( esc_html__( '%1$s by %2$s pixels' ), $attachment_data['width'], $attachment_data['height'] ),
     4369                                                        );
     4370                                                }
     4371                                        }
     4372                                        elseif ( ! empty( $attachment_data[ $extract_key ] ) ) {
     4373                                                $post_data_to_export[] = array(
     4374                                                        'name'  => $label,
     4375                                                        'value' => esc_html( $attachment_data[ $extract_key ] ),
     4376                                                );
     4377                                        }
     4378                                }
     4379                        }
     4380
    43494381                        $data_to_export[] = array(
    43504382                                'group_id'          => 'media',
    43514383                                'group_label'       => __( 'Media' ),