action hook for enabling and disabling redirection

[ad_1]

Hello @wp-henne

we don’t have a hook within out plugin but you can use WordPress standard hooks. I use this snippet to redirect all email when I’m on a development site (domains ending with “.loc”):

// redirect all e-mails to me
if( strpos( $_SERVER['SERVER_NAME'], '.loc' ) ){
	add_filter( 'wp_mail', function ( $args ) {
		$args['to'] = '[email protected]';
		$args['subject'] = '[' . $_SERVER['SERVER_NAME'] . '] ' . $args['subject'];
		return $args;
	}, 1000 );
}

a simplified version could be:

add_filter( 'wp_mail', function ( $args ) {
	$args['to'] = '[email protected]';
	return $args;
}, 1000 );

best regards, Hannes

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer