Deprecation warnings for PHP 8.2
When the plugin is first installed and before it is configured, the following warnings appear. It’s coming from these lines:
$api_key = trim($this->get_plugin_setting( 'api_key' ));
$api_hostname = trim($this->get_plugin_setting( 'api_hostname' ));
$api_endpoint = trim($this->get_plugin_setting( 'api_endpoint' ));
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /wp-content/plugins/vision6-gravity-forms/class-gf-vision6.php on line 1310
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /wp-content/plugins/vision6-gravity-forms/class-gf-vision6.php on line 1313
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /wp-content/plugins/vision6-gravity-forms/class-gf-vision6.php on line 1318
Just needs a null check — something like this:
$api_key = trim($this->get_plugin_setting( 'api_key' ) ?? '');
مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد
منبع: انجمن وردپرس