Make WordPress Core

Ticket #48014: 48014.diff

File 48014.diff, 569 bytes (added by rebasaurus, 7 years ago)

We can utilize the 4th parameter of add_post_meta() to prevent duplicate entries.

  • src/wp-includes/post.php

     
    67826782        }
    67836783
    67846784        if ( get_option( 'default_pingback_flag' ) ) {
    6785                 add_post_meta( $post_id, '_pingme', '1' );
     6785                add_post_meta( $post_id, '_pingme', '1', true );
    67866786        }
    6787         add_post_meta( $post_id, '_encloseme', '1' );
     6787        add_post_meta( $post_id, '_encloseme', '1', true );
    67886788
    67896789        if ( ! wp_next_scheduled( 'do_pings' ) ) {
    67906790                wp_schedule_single_event( time(), 'do_pings' );