@@ -208,14 +208,15 @@ public static function send_webmentions( $post_id ) {
208
208
$ urls = webmention_extract_urls ( $ post ->post_content , $ support_media_urls );
209
209
210
210
// filter links
211
- $ targets = apply_filters ( 'webmention_links ' , $ urls , $ post_id );
212
- $ targets = array_unique ( $ targets );
213
- $ pung = get_pung ( $ post );
211
+ $ targets = apply_filters ( 'webmention_links ' , $ urls , $ post_id );
212
+ $ targets = array_unique ( $ targets );
213
+ $ mentioned = get_post_meta ( $ post ->ID , 'webmention_last_mentioned_urls ' , true );
214
+ $ mentioned = empty ( $ mentioned ) ? array () : $ mentioned ;
214
215
215
216
// Find previously sent Webmentions and send them one last time.
216
- $ deletes = array_diff ( $ pung , $ targets );
217
+ $ deletes = array_diff ( $ mentioned , $ targets );
217
218
218
- $ ping = array ();
219
+ $ mentions = array ();
219
220
220
221
foreach ( $ targets as $ target ) {
221
222
// send Webmention
@@ -230,7 +231,7 @@ public static function send_webmentions( $post_id ) {
230
231
! is_wp_error ( $ response ) &&
231
232
wp_remote_retrieve_response_code ( $ response ) < 400
232
233
) {
233
- $ ping [] = $ target ;
234
+ $ mentions [] = $ target ;
234
235
}
235
236
236
237
// reschedule if server responds with a http error 5xx
@@ -246,15 +247,15 @@ public static function send_webmentions( $post_id ) {
246
247
// reschedule if server responds with a http error 5xx
247
248
if ( wp_remote_retrieve_response_code ( $ response ) >= 500 ) {
248
249
self ::reschedule ( $ post_id );
249
- $ ping [] = $ deleted ;
250
+ $ mentions [] = $ deleted ;
250
251
}
251
252
}
252
253
253
- if ( ! empty ( $ ping ) ) {
254
- self :: update_ping ( $ post , $ ping );
254
+ if ( ! empty ( $ mentions ) ) {
255
+ update_post_meta ( $ post_id , ' webmention_last_mentioned_urls ' , $ mentions );
255
256
}
256
257
257
- return $ ping ;
258
+ return $ mentions ;
258
259
}
259
260
260
261
/*
0 commit comments