Skip to content

Instantly share code, notes, and snippets.

@tripflex
Last active November 29, 2022 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/56a368332138d1e703d3111d665a971e to your computer and use it in GitHub Desktop.
Save tripflex/56a368332138d1e703d3111d665a971e to your computer and use it in GitHub Desktop.
Disable showing localize() warning when WP_DEBUG is enabled
<?php
add_filter( 'doing_it_wrong_trigger_error', 'smyles_disable_localize_warning', 9999, 2 );
function smyles_disable_localize_warning( $trigger, $function ){
if( $function === 'WP_Scripts::localize' ){
return false;
}
return $trigger;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment