Deprecated notice for preg_match | WordPress.org

[ad_1]

My PHP version is 8.1.23 and I am seeing a deprecated notice. I have adapted this code and it got resolved but please fix it in the next update:

	/**
	 * Check if key is valid
	 *
	 * @param $key
	 *
	 * @return bool
	 */
	public static function keyIsValid( $key ) {
		return is_string( $key ) && ! preg_match( '/[^\p{L}\p{N}\:\.\_\s\-]+/u', $key );
	}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer