]+)>/', $email_address, $matches ) ) { $email_address = $matches[1]; } $email_address = trim( strtolower( $email_address ) ); if ( ! in_array( $email_address, $allowed_emails, true ) ) { error_log( sprintf( '[HVAC Staging] Blocked email to: %s | Subject: %s', is_array( $to ) ? implode( ', ', $to ) : $to, $args['subject'] ) ); $args['to'] = ''; return $args; } $args['subject'] = '[STAGING] ' . $args['subject']; return $args; } add_filter( 'wp_mail', 'hvac_staging_email_filter', 1 ); // Load the main plugin class require_once plugin_dir_path(__FILE__) . 'includes/class-hvac-plugin.php'; /** * Initialize the plugin * * @return HVAC_Plugin */ function hvac_community_events() { return HVAC_Plugin::instance(); } // Initialize the plugin hvac_community_events();