wp/wp-trackback.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   125 	$comment_content      = "<strong>$title</strong>\n\n$excerpt";
   125 	$comment_content      = "<strong>$title</strong>\n\n$excerpt";
   126 	$comment_type         = 'trackback';
   126 	$comment_type         = 'trackback';
   127 
   127 
   128 	$dupe = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url ) );
   128 	$dupe = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url ) );
   129 	if ( $dupe ) {
   129 	if ( $dupe ) {
   130 		trackback_response( 1, __( 'We already have a ping from that URL for this post.' ) );
   130 		trackback_response( 1, __( 'There is already a ping from that URL for this post.' ) );
   131 	}
   131 	}
   132 
   132 
   133 	$commentdata = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type' );
   133 	$commentdata = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type' );
   134 
   134 
   135 	$result = wp_new_comment( $commentdata );
   135 	$result = wp_new_comment( $commentdata );