wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



_wp_connectors_mask_api_key › WordPress Function

Da7.0.0
Deprecaton/a
› _wp_connectors_mask_api_key ( $key )
Accedi:
  • private
Parametri:
  • (string) $key The API key to mask.
    Richiesto: Sì
Ritorna:
  • (string) The masked key, e.g. "************fj39".
Definito a:
Codex:

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



Sorgenti

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