| 1 |
<?php |
| 2 |
/** |
| 3 |
* Data online for help center |
| 4 |
*/ |
| 5 |
?> |
| 6 |
|
| 7 |
<?php if ( ! empty( $whats_new ) ) : ?> |
| 8 |
<div class="lp-help-center-whats-new"> |
| 9 |
<div class="lp-help-center-whats-new__main"> |
| 10 |
<?php if ( ! empty( $whats_new['badge'] ) ) : ?> |
| 11 |
<span class="lp-help-center-whats-new__badge"><?php echo esc_html( $whats_new['badge'] ); ?></span> |
| 12 |
<?php endif; ?> |
| 13 |
|
| 14 |
<?php if ( ! empty( $whats_new['title'] ) ) : ?> |
| 15 |
<h2><?php echo esc_html( $whats_new['title'] ); ?></h2> |
| 16 |
<?php endif; ?> |
| 17 |
|
| 18 |
<?php if ( ! empty( $whats_new['description'] ) ) : ?> |
| 19 |
<p><?php echo esc_html( $whats_new['description'] ); ?></p> |
| 20 |
<?php endif; ?> |
| 21 |
|
| 22 |
<?php if ( ! empty( $whats_new['cta_text'] ) ) : ?> |
| 23 |
<a class="button button-primary lp-help-center-whats-new__cta" href="<?php echo esc_url( $whats_new['cta_url'] ?? '#' ); ?>" target="_blank" rel="noopener noreferrer"> |
| 24 |
<?php echo esc_html( $whats_new['cta_text'] ); ?> |
| 25 |
</a> |
| 26 |
<?php endif; ?> |
| 27 |
</div> |
| 28 |
|
| 29 |
<?php if ( ! empty( $whats_new['features'] ) ) : ?> |
| 30 |
<ul class="lp-help-center-whats-new__features"> |
| 31 |
<?php foreach ( $whats_new['features'] as $feature ) : ?> |
| 32 |
<li> |
| 33 |
<span class="lp-help-center-whats-new__tick"> |
| 34 |
<?php echo $tick_icon ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- trusted local SVG file content via LP_WP_Filesystem::get_icon_svg(). ?> |
| 35 |
</span> |
| 36 |
<?php echo esc_html( $feature ); ?> |
| 37 |
</li> |
| 38 |
<?php endforeach; ?> |
| 39 |
</ul> |
| 40 |
<?php endif; ?> |
| 41 |
</div> |
| 42 |
<?php endif; ?> |
| 43 |
|
| 44 |
<div class="lp-help-center-bottom"> |
| 45 |
<?php if ( ! empty( $articles['items'] ) ) : ?> |
| 46 |
<div class="lp-help-center-articles"> |
| 47 |
<div class="lp-help-center-articles__header"> |
| 48 |
<h2><?php echo esc_html( $articles['title'] ?? __( 'Latest LearnPress Articles', 'learnpress' ) ); ?></h2> |
| 49 |
<?php if ( ! empty( $articles['more_url'] ) ) : ?> |
| 50 |
<a href="<?php echo esc_url( $articles['more_url'] ); ?>" target="_blank" rel="noopener noreferrer"> |
| 51 |
<?php echo esc_html( $articles['more_text'] ?? __( 'More', 'learnpress' ) ); ?> |
| 52 |
</a> |
| 53 |
<?php endif; ?> |
| 54 |
</div> |
| 55 |
|
| 56 |
<ul class="lp-help-center-articles__list"> |
| 57 |
<?php foreach ( $articles['items'] as $article ) : ?> |
| 58 |
<li> |
| 59 |
<a href="<?php echo esc_url( $article['url'] ?? '#' ); ?>" target="_blank" rel="noopener noreferrer"> |
| 60 |
<span class="lp-help-center-articles__thumbnail"> |
| 61 |
<?php if ( ! empty( $article['image'] ) ) : ?> |
| 62 |
<img src="<?php echo esc_url( $article['image'] ); ?>" alt="<?php echo esc_attr( $article['title'] ?? '' ); ?>" /> |
| 63 |
<?php endif; ?> |
| 64 |
</span> |
| 65 |
|
| 66 |
<span class="lp-help-center-articles__text"> |
| 67 |
<strong><?php echo esc_html( $article['title'] ?? '' ); ?></strong> |
| 68 |
<span><?php echo esc_html( $article['subtitle'] ?? '' ); ?></span> |
| 69 |
</span> |
| 70 |
|
| 71 |
<span class="dashicons dashicons-arrow-right-alt2"></span> |
| 72 |
</a> |
| 73 |
</li> |
| 74 |
<?php endforeach; ?> |
| 75 |
</ul> |
| 76 |
</div> |
| 77 |
<?php endif; ?> |
| 78 |
|
| 79 |
<?php if ( ! empty( $banner_ad ) ) : ?> |
| 80 |
<div class="lp-help-center-banner-ad"> |
| 81 |
<?php if ( ! empty( $banner_ad['image'] ) && ! empty( $banner_ad['url'] ) ) : ?> |
| 82 |
<a href="<?php echo esc_url( $banner_ad['url'] ); ?>" target="_blank" rel="noopener noreferrer"> |
| 83 |
<img src="<?php echo esc_url( $banner_ad['image'] ); ?>" alt="<?php esc_attr_e( 'LearnPress', 'learnpress' ); ?>" /> |
| 84 |
</a> |
| 85 |
<?php elseif ( ! empty( $banner_ad['image'] ) ) : ?> |
| 86 |
<img src="<?php echo esc_url( $banner_ad['image'] ); ?>" alt="<?php esc_attr_e( 'LearnPress', 'learnpress' ); ?>" /> |
| 87 |
<?php else : ?> |
| 88 |
<div class="lp-help-center-banner-ad__placeholder"> |
| 89 |
<span class="dashicons dashicons-format-image"></span> |
| 90 |
<p><?php esc_html_e( 'No banner image set', 'learnpress' ); ?></p> |
| 91 |
</div> |
| 92 |
<?php endif; ?> |
| 93 |
</div> |
| 94 |
<?php endif; ?> |
| 95 |
</div> |
| 96 |
|
| 97 |
|