wordpress-theme-framework
wordpress-theme-framework copied to clipboard
Singleton pattern no more working with php 8.1
Hello after updating PHP 8.1 we are fetching issues like not showing more custom taxonomy or CPTs because of the Singleton pattern no more working with PHP 8.1 so below is the solution for the same.
https://github.com/justcoded/wordpress-theme-framework/blob/34d1ac1157b19b287b77e2da076b01e32a866f39/framework/Objects/Singleton.php#L15
Replace this with below
public static function instance() { static $instance=[]; if (!isset($instance[static::class])) { $instance[static::class] = new static(); } return $instance[static::class]; }
Thanks for the report. We will check and merge if everything is fine