Filter hook 'sanitize_email'

in WP Core File wp-includes/formatting.php at line 3856

View Source

sanitize_email

Filter Hook
Description
return apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' ); } /* DOMAIN PART Test for sequences of periods.

Hook Information

File Location wp-includes/formatting.php View on GitHub
Hook Type Filter
Line Number 3856

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into sanitize_email
add_filter('sanitize_email', 'my_custom_filter');

function my_custom_filter() {
    // Your custom filtering logic here
    return 'modified_value';
}

Source Code Context

wp-includes/formatting.php:3856 - How this hook is used in WordPress core
<?php
3851  	// Put the email back together.
3852  	$sanitized_email = $local . '@' . $domain;
3853  
3854  	// Congratulations, your email made it!
3855  	/** This filter is documented in wp-includes/formatting.php */
3856  	return apply_filters( 'sanitize_email', $sanitized_email, $email, null );
3857  }
3858  
3859  /**
3860   * Determines the difference between two timestamps.
3861   *

PHP Documentation

<?php
/** This filter is documented in wp-includes/formatting.php */
		return apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );
	}

	/*
	 * DOMAIN PART
	 * Test for sequences of periods.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 0
  • File: wp-includes/formatting.php
Related Hooks

Related hooks will be displayed here in future updates.