Move Rest API spam blocking outside of CF7 code block
All checks were successful
Generate Build Info / build-info (push) Successful in 2s
All checks were successful
Generate Build Info / build-info (push) Successful in 2s
This commit is contained in:
17
dapper.php
17
dapper.php
@@ -1248,9 +1248,14 @@ if ( class_exists( 'WPCF7' ) ) {
|
||||
</span>';
|
||||
return $hp . $form;
|
||||
}
|
||||
add_filter('rest_pre_dispatch', 'dapper_block_cf7_rest_spam', 10, 3);
|
||||
|
||||
function dapper_block_cf7_rest_spam($result, $server, $request) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
add_filter('rest_pre_dispatch', 'dapper_block_cf7_rest_spam', 10, 3);
|
||||
|
||||
function dapper_block_cf7_rest_spam($result, $server, $request) {
|
||||
|
||||
$route = $request->get_route();
|
||||
$ip = $_SERVER['REMOTE_ADDR'] ?? 'unknown';
|
||||
@@ -1305,14 +1310,12 @@ if ( class_exists( 'WPCF7' ) ) {
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function add_campaign_management_page() {
|
||||
add_submenu_page(
|
||||
'edit.php?post_type=email_template', // Parent menu slug
|
||||
|
||||
Reference in New Issue
Block a user