Error in PHP8.0 (PHP-FPM) | WordPress.org

[ad_1]

This happened in my environment, so I'm reporting it.

PHP-FPM 8.0.30
WordPress 6.5.5
ACF PRO 6.3.6 (latest)

When I enabled the plugin, the following error occurred and it was not displayed.

Parse error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /wp-content/plugins/advanced-custom-fields-pro/includes/class-acf-site-health.php on line 23

When I checked, it seems that there was an error in checking the property type declaration.

public string $option_name="acf_site_health";
       ↓
public $option_name="acf_site_health";

After correcting it like this, it was displayed normally.

 

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