wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_is_valid_icon_name › WordPress Function

Since7.2.0
已弃用n/a
› wp_is_valid_icon_name ( $icon_name )
参数:
  • (mixed) $icon_name The value to check.
    Required: Yes
返回:
  • (bool) True if the value has the form of a namespaced icon name, else false.
定义在:
文档:

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



源码

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