Created
November 25, 2024 05:00
-
-
Save n7studios/cec76acd6652ab1cc74f8ca6b8cbba0f to your computer and use it in GitHub Desktop.
Disable "Notice: Function _load_textdomain_just_in_time was called incorrectly" in WordPress 6.7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Disable `_load_textdomain_just_in_time` `doing_it_wrong` notice | |
* | |
* @package ConvertKit | |
* @author ConvertKit | |
* | |
* @wordpress-plugin | |
* Plugin Name: Disable `_load_textdomain_just_in_time` `doing_it_wrong` notice | |
* Plugin URI: https://www.wpzinc.com/ | |
* Description: Disable `_load_textdomain_just_in_time` `doing_it_wrong` notice | |
* Version: 0.0.1 | |
* Author: WP Zinc | |
* Author URI: https://www.wpzinc.com/ | |
*/ | |
/** | |
* Prevents the "Notice: Function _load_textdomain_just_in_time was called incorrectly" | |
* from being output when WP_DEBUG is enabled. | |
* | |
* Allows other calls to `_doing_it_wrong` to still output their PHP notices. | |
* | |
* @since 0.0.1 | |
* | |
* @param bool $result Output notice. | |
* @param string $function_name Function name. | |
* @return bool | |
*/ | |
add_filter( 'doing_it_wrong_trigger_error', function( $result, $function_name ) { | |
// If the notice trigger is for `_load_textdomain_just_in_time`, ignore it. | |
if ( $function_name === '_load_textdomain_just_in_time' ) { | |
return false; | |
} | |
return $result; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not working for me