wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_is_valid_icon_name › WordPress Function

Seit7.2.0
Veraltetn/v
› wp_is_valid_icon_name ( $icon_name )
Parameter:
  • (mixed) $icon_name The value to check.
    Erforderlich: Ja
Gibt zurück:
  • (bool) True if the value has the form of a namespaced icon name, else false.
Definiert in:
Codex:

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



Quellcode

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