overview-notices.php
42 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Render box with problems and notifications on the Advanced Ads overview page |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * |
| 7 | * @var int $ignored_count number of ignored notices. |
| 8 | */ |
| 9 | |
| 10 | use AdvancedAds\Utilities\Data; |
| 11 | |
| 12 | ?> |
| 13 | <div class="advads-widget-wrapper pt-4"> |
| 14 | <?php if ( ! Advanced_Ads_Ad_Health_Notices::get_instance()->has_notices() ) : ?> |
| 15 | <div class="ml-2"><?php esc_html_e( 'There are no notifications.', 'advanced-ads' ); ?></div> |
| 16 | <?php else : ?> |
| 17 | <?php Advanced_Ads_Ad_Health_Notices::get_instance()->display_problems(); ?> |
| 18 | <?php Advanced_Ads_Ad_Health_Notices::get_instance()->display_notices(); ?> |
| 19 | <?php Advanced_Ads_Ad_Health_Notices::get_instance()->display_pitches(); ?> |
| 20 | |
| 21 | <div class="advads-ad-health-notices-show-hidden" <?php echo ! $ignored_count ? 'style="display: none;"' : ''; ?>> |
| 22 | <?php |
| 23 | printf( |
| 24 | /* translators: %s is the number of hidden notices. */ |
| 25 | esc_html__( '%s hidden notifications', 'advanced-ads' ), |
| 26 | '<span class="count">' . absint( $ignored_count ) . '</span>' |
| 27 | ); |
| 28 | ?> |
| 29 | </div> |
| 30 | <div class="advads-loader" style="display: none;"></div> |
| 31 | <?php endif; ?> |
| 32 | </div> |
| 33 | |
| 34 | <footer> |
| 35 | <span class="dashicons dashicons-lightbulb"></span> |
| 36 | <a class="no-underline" href="<?php echo esc_url( Data::support_url( '/?utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-notices-support' ) ); ?>" target="_blank"> |
| 37 | <?php esc_html_e( 'Save time and get personal support.', 'advanced-ads' ); ?> |
| 38 | <strong class="underline"><?php esc_html_e( 'Ask your question!', 'advanced-ads' ); ?></strong> |
| 39 | <span aria-hidden="true" class="dashicons dashicons-external"></span> |
| 40 | </a> |
| 41 | </footer> |
| 42 |