| @@ -16,8 +16,9 @@ | ||
| 16 | 16 | namespace LearnPress\TemplateHooks; |
| 17 | 17 | |
| 18 | 18 | use Exception; |
| 19 | 19 | use LearnPress\Helpers\Template; |
| 20 | +use LP_Debug; | |
| 20 | 21 | use stdClass; |
| 21 | 22 | use Throwable; |
| 22 | 23 | |
| 23 | 24 | class TemplateAJAX { |
| @@ -56,8 +57,9 @@ | ||
| 56 | 57 | $data = [ |
| 57 | 58 | 'args' => $args, |
| 58 | 59 | 'callback' => $callback, |
| 59 | 60 | 'id' => $target_id, |
| 61 | + 'method_request' => $args['method_request'] ?? 'POST', | |
| 60 | 62 | ]; |
| 61 | 63 | |
| 62 | 64 | // Remove argument html no need send via AJAX. |
| 63 | 65 | if ( ! empty( $args ) ) { |
| @@ -109,9 +111,9 @@ | ||
| 109 | 111 | $html_el_target, |
| 110 | 112 | $el_loading_after_content_loaded |
| 111 | 113 | ); |
| 112 | 114 | } catch ( Throwable $e ) { |
| 113 | - error_log( __METHOD__ . ' ' . $e->getMessage() ); | |
| 115 | + LP_Debug::error_log( $e ); | |
| 114 | 116 | } |
| 115 | 117 | |
| 116 | 118 | return Template::instance()->nest_elements( $html_wrapper, $html_content ); |
| 117 | 119 | } |