setting-additional-content.php
61 lines
| 1 | <?php |
| 2 | /** |
| 3 | * View to show the additional content setting for ads.txt. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | */ |
| 8 | |
| 9 | if ( $adsense_line ) : ?> |
| 10 | <p> |
| 11 | <span id="advads-ads-txt-adsense-notice" |
| 12 | data-enabled-text="<?php esc_attr_e( 'The following line will be added automatically because you connected your AdSense account with Advanced Ads:', 'advanced-ads' ); ?>" |
| 13 | data-disabled-text="<?php esc_attr_e( 'The AdSense record is not being added to ads.txt automatically.', 'advanced-ads' ); ?>"> |
| 14 | <?php if ( ! empty( $adsense_disabled ) ) : ?> |
| 15 | <?php esc_html_e( 'The AdSense record is not being added to ads.txt automatically.', 'advanced-ads' ); ?> |
| 16 | <?php else : ?> |
| 17 | <?php |
| 18 | echo wp_kses_post( |
| 19 | sprintf( |
| 20 | /* translators: %s: The adsense line added automatically by Advanced Ads. */ |
| 21 | __( 'The following line will be added automatically because you connected your AdSense account with Advanced Ads: %s', 'advanced-ads' ), |
| 22 | '<br><code>' . $adsense_line . '</code>' |
| 23 | ) |
| 24 | ); |
| 25 | ?> |
| 26 | <?php endif; ?> |
| 27 | </span> |
| 28 | <br><br> |
| 29 | <button |
| 30 | type="button" |
| 31 | class="button advads-ads-txt-action" |
| 32 | id="advads-ads-txt-toggle-adsense" |
| 33 | data-disable-label="<?php esc_attr_e( 'Remove from ads.txt', 'advanced-ads' ); ?>" |
| 34 | data-enable-label="<?php esc_attr_e( 'Add AdSense record to ads.txt', 'advanced-ads' ); ?>"> |
| 35 | <?php if ( $adsense_disabled ) : ?> |
| 36 | <?php esc_html_e( 'Add AdSense record to ads.txt', 'advanced-ads' ); ?> |
| 37 | <?php else : ?> |
| 38 | <?php esc_html_e( 'Remove from ads.txt', 'advanced-ads' ); ?> |
| 39 | <?php endif; ?> |
| 40 | </button> |
| 41 | </p> |
| 42 | <?php endif; ?> |
| 43 | |
| 44 | <br /> |
| 45 | <textarea cols="50" rows="5" id="advads-ads-txt-additional-content" name="advads-ads-txt-additional-content"><?php echo esc_textarea( $content ); ?></textarea> |
| 46 | <p class="description"><?php esc_html_e( 'Additional records to add to the file, one record per line. AdSense is added automatically.', 'advanced-ads' ); ?></p> |
| 47 | <div id="advads-ads-txt-notice-wrapper"> |
| 48 | <?php |
| 49 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 50 | echo $notices; |
| 51 | ?> |
| 52 | </div> |
| 53 | <p class="advads-notice-inline advads-error hidden" id="advads-ads-txt-notice-error"> |
| 54 | <?php |
| 55 | /* translators: %s is replaced with an error message. */ |
| 56 | esc_html_e( 'An error occured: %s.', 'advanced-ads' ); |
| 57 | ?> |
| 58 | </p> |
| 59 | <button class="button advads-ads-txt-action" type="button" id="advads-ads-txt-notice-refresh"><?php esc_html_e( 'Check for problems', 'advanced-ads' ); ?></button> |
| 60 | <a href="<?php echo esc_url( $link ); ?>" class="button" target="_blank"><?php esc_html_e( 'Preview', 'advanced-ads' ); ?></button> |
| 61 |