PHP notice
-
Ever since your last update, we are receiving a large number of PHP notices as follows
WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
Stack trace:
wp-includes/functions.php:5535 WP_Scripts->localize() wp-includes/functions.wp-scripts.php:221 wp_localize_script() wp-content/plugins/popup-builder/com/helpers/ScriptsIncluder.php:134 sgpb\ScriptsIncluder::localizeScript() wp-content/plugins/popup-builder/com/classes/ScriptsLoader.php:264 sgpb\ScriptsLoader->includeScripts() wp-content/plugins/popup-builder/com/classes/ScriptsLoader.php:138 sgpb\ScriptsLoader->loadToFooter() wp-content/plugins/popup-builder/com/classes/PopupLoader.php:156 sgpb\PopupLoader->loadPopups() wp-content/plugins/popup-builder/com/classes/Actions.php:852 sgpb\Actions->enqueuePopupBuilderScripts() wp-includes/class-wp-hook.php:303 do_action('wp_enqueue_scripts') wp-includes/script-loader.php:2083 wp_enqueue_scripts() wp-includes/class-wp-hook.php:303 do_action('wp_head') wp-includes/general-template.php:3015 wp_head()
As the message indicates, you are using
wp_localize_script
to pass data to javascript, but instead, you should be usingwp_add_inline_script
Those notices flood our logs, making it especially hard to identify actual issues.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘PHP notice’ is closed to new replies.