wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



_wp_connectors_mask_api_key › WordPress Function

Depuis7.0.0
Dépréciéen/a
› _wp_connectors_mask_api_key ( $key )
Accès:
  • private
Paramètres:
  • (string) $key The API key to mask.
    Requis: Oui
Retourne:
  • (string) The masked key, e.g. "************fj39".
Défini(e) dans:
Codex:

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



Source

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 );
}