Make WordPress Core

Ticket #41409: 41409.2.diff

File 41409.2.diff, 1.6 KB (added by geminorum, 7 years ago)
  • src/wp-includes/default-filters.php

    diff --git src/wp-includes/default-filters.php src/wp-includes/default-filters.php
    index 9212e42865..842b0b9eaf 100644
    add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop() 
    456456// Media
    457457add_action( 'wp_playlist_scripts', 'wp_playlist_scripts' );
    458458add_action( 'customize_controls_enqueue_scripts', 'wp_plupload_default_settings' );
     459add_filter( 'wp_update_attachment_metadata', '_remove_attachment_image_metadata' );
    459460
    460461// Nav menu
    461462add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 );
  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index 76cc0c11c9..eb4d64c91f 100644
    function wpview_media_sandbox_styles() { 
    39503950
    39513951        return array( $mediaelement, $wpmediaelement );
    39523952}
     3953
     3954/**
     3955 * Removes empty additional EXIF/IPTC data from attachment metadata.
     3956 *
     3957 * @return array of updated attachment meta data.
     3958 */
     3959function _remove_attachment_image_metadata( $data ) {
     3960       
     3961        if ( empty( $data['image_meta'] ) )
     3962                return $data;
     3963       
     3964        // Default EXIF/IPTC meta keys
     3965        $meta = array(
     3966                'aperture' => 0,
     3967                'credit' => '',
     3968                'camera' => '',
     3969                'caption' => '',
     3970                'created_timestamp' => 0,
     3971                'copyright' => '',
     3972                'focal_length' => 0,
     3973                'iso' => 0,
     3974                'shutter_speed' => 0,
     3975                'title' => '',
     3976                'orientation' => 0,
     3977                'keywords' => array(),
     3978        );
     3979       
     3980        foreach ( $meta as $key => $value ) {
     3981                if ( isset( $data['image_meta'][$key] ) && $value == $data['image_meta'][$key] ) {
     3982                        unset( $data['image_meta'][$key] );
     3983                }
     3984        }
     3985
     3986        return $data;
     3987}