Skip to content

Instantly share code, notes, and snippets.

@kowsar89
Created November 19, 2024 09:12
<?php
/**
* Plugin Name: Disable Textdomain Error
* Description: Prevents triggering errors for the '_load_textdomain_just_in_time' function.
* Author: Kowsar Hossain
* Version: 1.0
*
* Note: This is a Must-Use (MU) plugin. Place this file in the 'wp-content/mu-plugins' directory.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'doing_it_wrong_trigger_error', function( $status, $function_name ) {
if ( '_load_textdomain_just_in_time' === $function_name ) {
return false;
}
return $status;
}, 10, 2 );
@RoundAboutWEB
Copy link

What path does this file have to be in?

@kowsar89
Copy link
Author

@RoundAboutWEB your-site/wp-content/mu-plugins directory (you have to create the mu-plugins directory if it doesn't already exists)

@ara303
Copy link

ara303 commented Feb 1, 2025

A plugin I rely on has thus far opted not to fix this warning, and consequently spams my debug log while I'm trying to do normal dev work. This is the only thing that I've found which quells these exact notices and makes the aforementioned log file usable for me again. Thank you!

@RoundAboutWEB
Copy link

It works fine, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment