php 8.2 deprecated warnings + fix
-
Hey mate, there’s a deprecated warning in php8.2:
Deprecated: dirname(): Passing null to parameter #1 ($path) of type string is deprecated in /wp-content/plugins/head-meta-data/head-meta-data.php on line 49
Here’s how we fixed it: (should work with previous versions of php also)
We updated the function:function hmd_i18n_init() {
global $hmd_path;
$path = $hmd_path ? dirname($hmd_path) : null;
if ($path) {
load_plugin_textdomain(‘head-meta-data’, false, $path .’/languages/’);
}
}
add_action(‘init’, ‘hmd_i18n_init’);
Cheers,
Kent
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘php 8.2 deprecated warnings + fix’ is closed to new replies.