WordPress.org

Make WordPress Core

Ticket #10545: post.patch

File post.patch, 903 bytes (added by layotte, 5 years ago)
  • post.php

     
    41384138 
    41394139        $data = array( 'post_id' => $post_id, 'meta_value' => '1' ); 
    41404140        if ( get_option('default_pingback_flag') ) { 
    4141                 $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_pingme' ) ); 
     4141                get_post_meta($post_id, '_pingme') ? update_post_meta($post_id, '_pingme', 1) : add_post_meta($post_id, '_pingme', 1); 
    41424142                do_action( 'added_postmeta', $wpdb->insert_id, $post_id, '_pingme', 1 ); 
    41434143        } 
    4144         $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_encloseme' ) ); 
     4144        get_post_meta($post_id, '_encloseme') ? update_post_meta($post_id, '_encloseme', 1) : add_post_meta($post_id, '_encloseme', 1); 
    41454145        do_action( 'added_postmeta', $wpdb->insert_id, $post_id, '_encloseme', 1 ); 
    41464146 
    41474147        wp_schedule_single_event(time(), 'do_pings');