You appear to be a bot. Output may be restricted
Description
Given a domain, mask it with the * character.
TLD parts will remain intact (.com, .co.uk, etc). All subdomains will be masked t**t.e*****e.co.uk.
Usage
$string = edd_mask_domain( $domain );
Parameters
- $domain
- ( string ) optional –
Returns
string
Source
File name: easy-digital-downloads/includes/privacy-functions.php
Lines:
1 to 30 of 30
function edd_mask_domain( $domain = '' ) { if ( empty( $domain ) ) { return ''; } $domain_parts = explode( '.', $domain ); if ( count( $domain_parts ) === 2 ) { // We have a single entry tld like .org or .com $domain_parts[0] = edd_mask_string( $domain_parts[0] ); } else { $part_count = count( $domain_parts ); $possible_cctld = strlen( $domain_parts[ $part_count - 2 ] ) <= 3 ? true : false; $mask_parts = $possible_cctld ? array_slice( $domain_parts, 0, $part_count - 2 ) : array_slice( $domain_parts, 0, $part_count - 1 ); $i = 0; while ( $i < count( $mask_parts ) ) { $domain_parts[ $i ] = edd_mask_string( $domain_parts[ $i ]); $i++; } } return implode( '.', $domain_parts ); }