| 1 |
<?php |
| 2 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. |
| 3 |
|
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
if ( empty( $args ) || ! is_array( $args ) ) { |
| 9 |
return; |
| 10 |
} |
| 11 |
|
| 12 |
?> |
| 13 |
|
| 14 |
<tr> |
| 15 |
<td style="text-align: left; font-size: 20px; padding-top: 40px;"> |
| 16 |
<?php esc_html_e( 'Top Performing Docs', 'betterdocs' ); ?> |
| 17 |
</td> |
| 18 |
</tr> |
| 19 |
<tr> |
| 20 |
<td style="padding:0"> |
| 21 |
<table style="width: 100%; border-collapse: separate; border-spacing: 2px; padding-top: 20px;"> |
| 22 |
<tr style="background: #fff;"> |
| 23 |
<th style="text-align: left; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 15px; width: 48%;"> |
| 24 |
<?php esc_html_e( 'Doc Title', 'betterdocs' ); ?> |
| 25 |
</th> |
| 26 |
<th style="text-align: center; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 8px;"> |
| 27 |
<?php esc_html_e( 'Total Views', 'betterdocs' ); ?> |
| 28 |
</th> |
| 29 |
<th style="text-align: center; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 8px;"> |
| 30 |
<?php esc_html_e( 'Unique Views', 'betterdocs' ); ?> |
| 31 |
</th> |
| 32 |
<?php |
| 33 |
if ( $total_reactions > 0 ) { |
| 34 |
echo '<th style="text-align: center; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 15px;">' . esc_html__( 'Reactions', 'betterdocs' ) . '</th>'; |
| 35 |
} |
| 36 |
?> |
| 37 |
</tr> |
| 38 |
<?php |
| 39 |
foreach ( $args as $docs ) { |
| 40 |
betterdocs()->views->get( |
| 41 |
'admin/email/analytics/parts/single-docs', |
| 42 |
[ |
| 43 |
'docs' => $docs, |
| 44 |
'total_reactions' => $total_reactions |
| 45 |
] |
| 46 |
); |
| 47 |
} |
| 48 |
?> |
| 49 |
</table> |
| 50 |
</td> |
| 51 |
</tr> |
| 52 |
|