You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: liens-morts-detector-jlg/liens-morts-detector-jlg.php
+53-2Lines changed: 53 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -937,6 +937,50 @@ function blc_perform_link_update(array $args) {
937
937
return$success_payload;
938
938
}
939
939
940
+
/**
941
+
* Retrieve a single broken link row with contextual data.
942
+
*
943
+
* @param int $row_id Identifier of the broken link row.
944
+
* @return array|null
945
+
*/
946
+
functionblc_get_broken_link_row($row_id) {
947
+
global$wpdb;
948
+
949
+
$row_id = absint($row_id);
950
+
if ($row_id <= 0) {
951
+
returnnull;
952
+
}
953
+
954
+
$table_name = $wpdb->prefix . 'blc_broken_links';
955
+
$posts_table = $wpdb->posts;
956
+
957
+
$query = $wpdb->prepare(
958
+
"SELECT links.id, links.occurrence_index, links.url, links.anchor, links.redirect_target_url, links.context_html, links.context_excerpt, links.post_id, links.post_title, links.http_status, links.last_checked_at, links.ignored_at, posts.post_type AS post_type FROM {$table_name} AS links LEFT JOIN {$posts_table} AS posts ON links.post_id = posts.ID WHERE links.id = %d AND links.type = %s",
959
+
$row_id,
960
+
'link'
961
+
);
962
+
963
+
$row = $wpdb->get_row($query, ARRAY_A);
964
+
965
+
returnis_array($row) ? $row : null;
966
+
}
967
+
968
+
/**
969
+
* Render the HTML markup for a single broken link row.
970
+
*
971
+
* @param array $row Row data as returned by blc_get_broken_link_row().
0 commit comments