| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
| 2 | +if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly | |
| 3 | +} | |
| 3 | 4 | /** |
| 4 | 5 | * @var string $permalink |
| 5 | 6 | * @var string $user_avatar |
| 6 | 7 | * @var string $user_name |
| @@ -6,11 +7,15 @@ | ||
| 6 | 7 | * @var string $user_name |
| 7 | 8 | * @var string $community_name |
| 8 | 9 | * @var string $content |
| 9 | 10 | * @var string $linkColor |
| 11 | + * @var string $space_name | |
| 12 | + * @var string $title | |
| 10 | 13 | */ |
| 11 | 14 | |
| 12 | -$linkColor = !empty($linkColor) ? $linkColor : '#1f3349'; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- template-scoped variable injected by the view renderer | |
| 15 | +$fluentCommunityLinkColor = !empty($linkColor) ? $linkColor : '#1f3349'; | |
| 16 | +$fluentCommunitySpaceName = $space_name ?? ''; | |
| 17 | +$fluentCommunityTitle = $title ?? ''; | |
| 13 | 18 | ?> |
| 14 | 19 | <table width="100%" cellspacing="0" cellpadding="0" border="0"> |
| 15 | 20 | <tr> |
| 16 | 21 | <td style="font-family: Arial, sans-serif; font-size: 16px; line-height: 1.4; color: #333;"> |
| @@ -27,11 +32,11 @@ | ||
| 27 | 32 | <td style="font-family: Arial, sans-serif; font-size: 16px;color: #333; padding: 0 5px; vertical-align: middle;"> |
| 28 | 33 | <a style="text-decoration: none; color: #333;" href="<?php echo esc_url($permalink); ?>"> |
| 29 | 34 | <span style="font-weight: bold;"><?php echo esc_html($user_name); ?></span> |
| 30 | 35 | </a> |
| 31 | - <?php if($space_name): ?> | |
| 36 | + <?php if($fluentCommunitySpaceName): ?> | |
| 32 | 37 | <?php /* translators: %s is replaced by the title of the space */ ?> |
| 33 | - <span style="font-family: Arial, sans-serif; font-size: 12px; font-weight: normal; margin: 0;"><?php echo esc_html(sprintf(__('in %s', 'fluent-community'), $space_name)); ?></span> | |
| 38 | + <span style="font-family: Arial, sans-serif; font-size: 12px; font-weight: normal; margin: 0;"><?php echo esc_html(sprintf(__('in %s', 'fluent-community'), $fluentCommunitySpaceName)); ?></span> | |
| 34 | 39 | <?php endif; ?> |
| 35 | 40 | |
| 36 | 41 | <?php if(!empty($timestamp)): ?> |
| 37 | 42 | <?php /* translators: %s is replaced by the time ago */ ?> |
| @@ -43,16 +48,16 @@ | ||
| 43 | 48 | </td> |
| 44 | 49 | </tr> |
| 45 | 50 | <tr> |
| 46 | 51 | <td style="padding: 0; line-height: 1.4;font-family: Helvetica, sans-serif;"> |
| 47 | - <?php if($title): ?> | |
| 48 | - <a href="<?php echo esc_url($permalink); ?>" style="color: <?php echo esc_attr($linkColor); ?>; display: block; overflow: hidden; margin: 0; line-height: 1.2; padding: 0; text-decoration: none;"> | |
| 49 | - <h2 style="color: <?php echo esc_attr($linkColor); ?>; display: block; font-size: 20px; overflow: hidden; margin: 0 0 10px 0; padding: 0; text-decoration: none;"><?php echo esc_html($title); ?></h2> | |
| 52 | + <?php if($fluentCommunityTitle): ?> | |
| 53 | + <a href="<?php echo esc_url($permalink); ?>" style="color: <?php echo esc_attr($fluentCommunityLinkColor); ?>; display: block; overflow: hidden; margin: 0; line-height: 1.2; padding: 0; text-decoration: none;"> | |
| 54 | + <h2 style="color: <?php echo esc_attr($fluentCommunityLinkColor); ?>; display: block; font-size: 20px; overflow: hidden; margin: 0 0 10px 0; padding: 0; text-decoration: none;"><?php echo esc_html($fluentCommunityTitle); ?></h2> | |
| 50 | 55 | </a> |
| 51 | 56 | <?php endif; ?> |
| 52 | 57 | <?php \FluentCommunity\App\Services\CustomSanitizer::sanitizeRichText($content, true); ?> |
| 53 | 58 | <?php if(!empty($show_read_more)): ?> |
| 54 | - <a href="<?php echo esc_url($permalink); ?>" style="color: <?php echo esc_attr($linkColor); ?>; text-decoration: none; font-weight: bold; font-size: 14px;"> | |
| 59 | + <a href="<?php echo esc_url($permalink); ?>" style="color: <?php echo esc_attr($fluentCommunityLinkColor); ?>; text-decoration: none; font-weight: bold; font-size: 14px;"> | |
| 55 | 60 | <?php echo esc_html__('...read more', 'fluent-community'); ?> |
| 56 | 61 | </a> |
| 57 | 62 | <?php endif; ?> |
| 58 | 63 | </td> |