alert-coming-soon.php
5 years ago
alert-pro.php
5 years ago
footer.php
5 years ago
logo.php
5 years ago
sidebar.php
5 years ago
toast-message.php
5 years ago
toast-message.php
50 lines
| 1 | <?php |
| 2 | |
| 3 | if ( !isset( $success_message) ) { |
| 4 | $success_message = esc_html__( "Settings Updated", "embedpress" ); |
| 5 | |
| 6 | } |
| 7 | if ( !isset( $error_message) ) { |
| 8 | $error_message = esc_html__( "Ops! Something went wrong.", "embedpress" ); |
| 9 | } |
| 10 | ?> |
| 11 | |
| 12 | <div class="embedpress-toast__message toast__message--success"> |
| 13 | <img src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/check.svg" alt=""> |
| 14 | <p><?php echo esc_html( $success_message); ?></p> |
| 15 | </div> |
| 16 | |
| 17 | <div class="embedpress-toast__message toast__message--error"> |
| 18 | <img src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/error.svg" alt=""> |
| 19 | <p><?php echo esc_html( $error_message); ?></p> |
| 20 | </div> |
| 21 | |
| 22 | <?php if (!empty( $_GET['success'])){ ?> |
| 23 | <script> |
| 24 | (function ($) { |
| 25 | let $success_message_node = $('.toast__message--success'); |
| 26 | $success_message_node.addClass('show'); |
| 27 | setTimeout(function (){ |
| 28 | $success_message_node.removeClass('show'); |
| 29 | history.pushState('', '', embedPressRemoveURLParameter(location.href, 'success')); |
| 30 | }, 3000); |
| 31 | |
| 32 | })(jQuery); |
| 33 | </script> |
| 34 | <?php |
| 35 | } elseif (!empty( $_GET['error'])){ ?> |
| 36 | <script> |
| 37 | (function ($) { |
| 38 | let $error_message_node = $('.toast__message--error'); |
| 39 | $error_message_node.addClass('show'); |
| 40 | setTimeout(function (){ |
| 41 | $error_message_node.removeClass('show'); |
| 42 | history.pushState('', '', embedPressRemoveURLParameter(location.href, 'error')); |
| 43 | }, 3000); |
| 44 | |
| 45 | })(jQuery); |
| 46 | </script> |
| 47 | <?php |
| 48 | } |
| 49 | ?> |
| 50 |