← All changes
|
includes/endpoints/class-charitable-email-preview-endpoint.php
+14
-2
1.7.0.2
→
1.8.13
View file →
| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | * Email preview endpoint. |
| 4 | 4 | * |
| 5 | 5 | * @package Charitable/Classes/Charitable_Email_Preview_Endpoint |
| 6 | 6 | * @author David Bisset |
| 7 | - * @copyright Copyright (c) 2022, WP Charitable LLC | |
| 7 | + * @copyright Copyright (c) 2023, WP Charitable LLC | |
| 8 | 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | 9 | * @since 1.5.0 |
| 10 | 10 | * @version 1.6.55 |
| 11 | 11 | */ |
| @@ -75,12 +75,23 @@ | ||
| 75 | 75 | * @param array $args Mixed arguments. |
| 76 | 76 | * @return boolean |
| 77 | 77 | */ |
| 78 | 78 | public function is_page( $args = array() ) { |
| 79 | - return array_key_exists( 'charitable_action', $_GET ) && 'preview_email' == $_GET['charitable_action']; | |
| 79 | + return array_key_exists( 'charitable_action', $_GET ) && 'preview_email' === $_GET['charitable_action']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | + * Whether the endpoint uses a custom template. | |
| 84 | + * | |
| 85 | + * @since 1.8.1.6 | |
| 86 | + * | |
| 87 | + * @return boolean | |
| 88 | + */ | |
| 89 | + public function uses_custom_template() { | |
| 90 | + return true; | |
| 91 | + } | |
| 92 | + | |
| 93 | + /** | |
| 83 | 94 | * Return the template to display for this endpoint. |
| 84 | 95 | * |
| 85 | 96 | * @since 1.5.0 |
| 86 | 97 | * @since 1.6.55 Now returns an array. |
| @@ -88,8 +99,9 @@ | ||
| 88 | 99 | * @param string $template The default template. |
| 89 | 100 | * @return array |
| 90 | 101 | */ |
| 91 | 102 | public function get_template( $template ) { |
| 103 | + | |
| 92 | 104 | do_action( 'charitable_email_preview' ); |
| 93 | 105 | |
| 94 | 106 | return array( 'emails/preview.php' ); |
| 95 | 107 | } |