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