wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_is_valid_icon_name › WordPress Function

Since7.2.0
Deprecatedn/a
› wp_is_valid_icon_name ( $icon_name )
Parameters:
  • (mixed) $icon_name The value to check.
    Required: Yes
Returns:
  • (bool) True if the value has the form of a namespaced icon name, else false.
Defined at:
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 );
}