Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singleton pattern no more working with php 8.1 #56

Open
jigar2002 opened this issue Nov 15, 2022 · 1 comment
Open

Singleton pattern no more working with php 8.1 #56

jigar2002 opened this issue Nov 15, 2022 · 1 comment

Comments

@jigar2002
Copy link

jigar2002 commented Nov 15, 2022

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.

public static function instance() {

Replace this with below

public static function instance() {
static $instance=[];
if (!isset($instance[static::class])) {
$instance[static::class] = new static();
}
return $instance[static::class];
}

@aprokopenko
Copy link
Collaborator

Thanks for the report. We will check and merge if everything is fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants