wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



_wp_connectors_mask_api_key › WordPress Function

Od7.0.0
Przestarzałyn/a
› _wp_connectors_mask_api_key ( $key )
Dostęp:
  • private
Parametry:
  • (string) $key The API key to mask.
    Wymagane: Tak
Powrót:
  • (string) The masked key, e.g. "************fj39".
Zdefiniowane na:
Codex:

Masks an API key, showing only the last 4 characters.



Źródło

function _wp_connectors_mask_api_key( string $key ): string {
	if ( strlen( $key ) <= 4 ) {
		return $key;
	}

	return str_repeat( "\u{2022}", min( strlen( $key ) - 4, 16 ) ) . substr( $key, -4 );
}