mirror of
https://github.com/szepeviktor/wordpress-website-lifecycle.git
synced 2025-08-17 18:11:08 +08:00
Add http and email blocking to core-migration
This commit is contained in:
parent
c92be675b9
commit
64b3bc8fda
1 changed files with 22 additions and 0 deletions
|
@ -20,3 +20,25 @@ add_filter(
|
|||
0,
|
||||
1
|
||||
);
|
||||
|
||||
// Block outbound HTTP requests
|
||||
add_filter(
|
||||
'pre_http_request',
|
||||
static function ($response, $parsed_args, $url) {
|
||||
error_log('Outbound HTTP requests are blocked: '.$url);
|
||||
return new WP_Error('outbound_http_blocked');
|
||||
},
|
||||
PHP_INT_MAX,
|
||||
3
|
||||
);
|
||||
|
||||
// Block email sending
|
||||
add_filter(
|
||||
'pre_wp_mail',
|
||||
static function ($return, $atts) {
|
||||
error_log('Email sending is blocked: '.var_export($atts, true));
|
||||
return false;
|
||||
},
|
||||
PHP_INT_MAX,
|
||||
2
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue