2 ms·
You could do this a lot easier: if ( !isset( $from_email ) ) { $sitename = parse_url( strtolower( WP_HOME ) )['host']; if ( substr( $sitename, 0, 4
by kels 9y ago
You could do this a lot easier:
if ( !isset( $from_email ) ) {
$sitename = parse_url( strtolower( WP_HOME ) )['host'];
if ( substr( $sitename, 0, 4 ) == 'www.' ) {
$sitename = substr( $sitename, 4 );
}
$from_email = 'wordpress@' . $sitename;
}
Edit: you still need to strip out www. if it exits. Also not compatible with < PHP 5.4
- simlevesque 9y agoThey might have avoided this code for compatibility.