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



wp_is_valid_icon_name › WordPress Function

Depuis7.2.0
Dépréciéen/a
› wp_is_valid_icon_name ( $icon_name )
Paramètres:
  • (mixed) $icon_name The value to check.
    Requis: Oui
Retourne:
  • (bool) True if the value has the form of a namespaced icon name, else false.
Défini(e) dans:
Codex:

Checks whether a value has the form of a namespaced icon name, i.e. "collection/icon-name".



Source

function wp_is_valid_icon_name( $icon_name ) {
	return is_string( $icon_name )
		&& preg_match( '#^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?/[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?$#D', $icon_name );
}