-
Notifications
You must be signed in to change notification settings - Fork 9
New. Integration. Integration with Pagelayer #896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cff8f5c
1deb352
efd0bf9
5cc8942
e00ae42
7f04a5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| <?php | ||
|
|
||
| namespace Cleantalk\Antispam\Integrations; | ||
|
|
||
| use Cleantalk\ApbctWP\Variables\Post; | ||
|
|
||
| class Pagelayer extends IntegrationBase | ||
| { | ||
| public function getDataForChecking($argument) | ||
| { | ||
| $event_token = Post::getString('ct_bot_detector_event_token'); | ||
|
|
||
| /** | ||
| * Filter for POST | ||
| */ | ||
| $input_array = apply_filters('apbct__filter_post', $_POST); | ||
|
|
||
| $service_fields = array( | ||
| 'apbct_visible_fields', | ||
| 'ct_bot_detector_event_token', | ||
| 'ct_no_cookie_hidden_field', | ||
| 'action', | ||
| 'pagelayer_nonce', | ||
| 'pagelayer-contact-submit', | ||
| 'cfa-pagelayer-id', | ||
| 'cfa-post-id', | ||
| 'cfa-custom-template', | ||
| 'cfa-redirect', | ||
| ); | ||
|
|
||
| foreach ( $service_fields as $service_field ) { | ||
| unset($input_array[$service_field]); | ||
| } | ||
|
|
||
| $base_call_data = ct_gfa_dto($input_array)->getArray(); | ||
|
|
||
| $base_call_data['event_token'] = $event_token; | ||
|
|
||
| return $base_call_data; | ||
| } | ||
|
|
||
| public function doBlock($message) | ||
| { | ||
| // Pagelayer frontend renders the 'failed' key as the form error message | ||
| echo json_encode(array('failed' => $message)); | ||
| wp_die(); | ||
| } | ||
|
|
||
| public function allow() | ||
| { | ||
| return 1; | ||
| } | ||
|
|
||
| /** | ||
| * Pagelayer copies $_POST into its own $formdata right after this filter returns, | ||
| * so service fields have to be dropped here to keep them out of the email body. | ||
| */ | ||
| public function doFinalActions($argument) | ||
| { | ||
| apbct_clear_post_service_data_after_base_call(); | ||
|
|
||
| return $argument; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.