WordPress.org

Make WordPress Core

Ticket #16391: 16391.diff

File 16391.diff, 447 bytes (added by Caspie, 7 years ago)

empty() is faster :)

  • post.php

     
    37963796
    37973797        $data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID );
    37983798
    3799         return update_post_meta( $post->ID, '_wp_attachment_metadata', $data);
     3799        if ( ! empty($data) )
     3800                return update_post_meta( $post->ID, '_wp_attachment_metadata', $data );
     3801
     3802        return false;
    38003803}
    38013804
    38023805/**