Skip to main content

benecaster_outlinks_health_digest_subject

Filter Premium outlinks

Filters the subject of the Link Health email digest. It runs only when a digest is about to be sent: at the end of a finished check, when the digest frequency has passed, something has broken that the last digest did not report, and the site’s admin email is a valid address. The subject filter runs first, then benecaster_outlinks_health_digest_body.

$new_items are the newly broken items, in the shape benecaster_outlinks_health_check_completed describes.

Parameters

Name Type Default Description
$subject string — The default subject, such as "Link Health: 3 newly broken links or images on {site name}"
$new_items array — The items broken since the last digest
$total_broken int — How many items are broken in all

Returns: string

Example

add_filter( 'benecaster_outlinks_health_digest_subject', function ( string $subject, array $new_items, int $total_broken ): string {
    return sprintf( '[%s] %s', get_bloginfo( 'name' ), $subject );
}, 10, 3 );

Notes

The return is trimmed. A return that is not a string, or is empty once trimmed, keeps the default; it cannot cancel the email (an empty body can). To stop the digest altogether, set its schedule to off on Settings → Link Health. Change the sender with Benecaster's benecaster_email_from_* filters. Walkthrough: Change the subject or body of the Link Health email digest, or skip one.

Need this built rather than just documented? See our services →