| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template contains the text for the New Friend Post notification e-mail. |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
$ensure_linebreaks = preg_replace( '/\<br(\s*)?\/?\>/i', PHP_EOL, $args['post']->post_content ); |
| 10 |
$plain_text = wp_strip_all_tags( $ensure_linebreaks ); |
| 11 |
$normalized_whitespace = preg_replace( '/(' . PHP_EOL . '\s*' . PHP_EOL . ')+/m', PHP_EOL . PHP_EOL, $plain_text ); |
| 12 |
$quoted_text = '> ' . str_replace( PHP_EOL, PHP_EOL . '> ', trim( $normalized_whitespace ) ); |
| 13 |
|
| 14 |
// This is a text e-mail, not a place for HTML escaping. |
| 15 |
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped |
| 16 |
echo $quoted_text; |
| 17 |
|
| 18 |
echo PHP_EOL, PHP_EOL; |
| 19 |
|
| 20 |
printf( |
| 21 |
// translators: %1$s is a username, %2$s is a URL. |
| 22 |
__( 'This post was published by your friend %1$s at %2$s', 'friends' ), |
| 23 |
$args['author']->display_name, |
| 24 |
get_permalink( $args['post'] ) |
| 25 |
); |
| 26 |
|
| 27 |
echo PHP_EOL; |
| 28 |
printf( |
| 29 |
// translators: %s is a URL. |
| 30 |
__( 'You can also view this post on your friends page: %s', 'friends' ), |
| 31 |
$args['author']->get_local_friends_page_url( $args['post']->ID ) |
| 32 |
); |
| 33 |
echo PHP_EOL, PHP_EOL; |
| 34 |
|
| 35 |
printf( |
| 36 |
// translators: %s is a URL. |
| 37 |
__( 'Manage your subscription settings at %s', 'friends' ), |
| 38 |
$args['author']->display_name, |
| 39 |
self_admin_url( 'admin.php?page=friends-settings' ) |
| 40 |
); |
| 41 |
echo PHP_EOL; |
| 42 |
|
| 43 |
printf( |
| 44 |
// translators: %1$s is a username, %2$s is a URL. |
| 45 |
__( 'Or just unsubscribe from %1$s\'s posts at %2$s', 'friends' ), |
| 46 |
$args['author']->display_name, |
| 47 |
self_admin_url( 'admin.php?page=edit-friend&user=' . $args['author']->user_login ) |
| 48 |
); |
| 49 |
|