| @@ -61,8 +61,9 @@ | ||
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * Load receipt view. |
| 64 | 64 | * |
| 65 | + * @since 3.16.0 add action give_donation_confirmation_page_enqueue_scripts | |
| 65 | 66 | * @since 2.7.0 |
| 66 | 67 | */ |
| 67 | 68 | public function loadReceiptView() |
| 68 | 69 | { |
| @@ -70,8 +71,10 @@ | ||
| 70 | 71 | if (FormUtils::isLegacyForm()) { |
| 71 | 72 | return; |
| 72 | 73 | } |
| 73 | 74 | |
| 75 | + do_action('give_donation_confirmation_page_enqueue_scripts'); | |
| 76 | + | |
| 74 | 77 | // Handle success page. |
| 75 | 78 | if (FormUtils::isViewingFormReceipt() && ! FormUtils::isLegacyForm()) { |
| 76 | 79 | /* @var Template $formTemplate */ |
| 77 | 80 | $formTemplate = Give()->templates->getTemplate(); |
| @@ -112,9 +115,8 @@ | ||
| 112 | 115 | // Render receipt with in iframe. |
| 113 | 116 | include $formTemplate->getReceiptView(); |
| 114 | 117 | exit(); |
| 115 | 118 | } |
| 116 | - | |
| 117 | 119 | // Render receipt on success page in iframe. |
| 118 | 120 | add_filter('the_content', [$this, 'showReceiptInIframeOnSuccessPage'], 1); |
| 119 | 121 | } |
| 120 | 122 | } |
| @@ -163,8 +165,9 @@ | ||
| 163 | 165 | |
| 164 | 166 | /** |
| 165 | 167 | * Handle receipt shortcode on success page |
| 166 | 168 | * |
| 169 | + * @since 3.16.0 add filter give_donation_confirmation_success_page_shortcode_view | |
| 167 | 170 | * @since 2.7.0 |
| 168 | 171 | * |
| 169 | 172 | * @param string $content |
| 170 | 173 | * |
| @@ -172,11 +175,12 @@ | ||
| 172 | 175 | */ |
| 173 | 176 | public function showReceiptInIframeOnSuccessPage($content) |
| 174 | 177 | { |
| 175 | 178 | $receiptShortcode = ShortcodeUtils::getReceiptShortcodeFromConfirmationPage(); |
| 176 | - $content = str_replace($receiptShortcode, give_form_shortcode([]), $content); | |
| 177 | 179 | |
| 178 | - return $content; | |
| 180 | + $view = apply_filters('give_donation_confirmation_success_page_shortcode_view', give_form_shortcode([])); | |
| 181 | + | |
| 182 | + return str_replace($receiptShortcode, $view, $content); | |
| 179 | 183 | } |
| 180 | 184 | |
| 181 | 185 | /** |
| 182 | 186 | * Load form template |