# wordpress-seo/28.6/src/initializers/silence-load-textdomain-just-in-time-notices.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version 28.6. 49 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/28.6/code/src/initializers/silence-load-textdomain-just-in-time-notices.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/28.6/raw/src/initializers/silence-load-textdomain-just-in-time-notices.php
- Modified: 2025-10-08T14:12:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/28.6/code/src/initializers/silence-load-textdomain-just-in-time-notices.php#L10-L20`.

```php
<?php

namespace Yoast\WP\SEO\Initializers;

use Yoast\WP\SEO\Conditionals\WP_Tests_Conditional;

/**
 * Silences load_textdomain_just_in_time issues when running WP tests.
 *
 * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
 */
class Silence_Load_Textdomain_Just_In_Time_Notices implements Initializer_Interface {

	/**
	 * Returns the conditionals based in which this loadable should be active.
	 *
	 * @return array<string> The array of conditionals.
	 */
	public static function get_conditionals() {
		return [ WP_Tests_Conditional::class ];
	}

	/**
	 * Hooks our required hooks.
	 *
	 * @return void
	 */
	public function initialize() {
		\add_filter( 'doing_it_wrong_trigger_error', [ $this, 'silence_textdomain_notices' ], 10, 2 );
	}

	/**
	 * Silences textdomain notices.
	 *
	 * @param bool   $trigger       Whether to trigger the error. Default true.
	 * @param string $function_name The function name that triggered the error.
	 *
	 * @return bool
	 */
	public function silence_textdomain_notices( $trigger, $function_name ) {
		if ( $function_name === '_load_textdomain_just_in_time' ) {
			// Silence the notice.
			return false;
		}

		return $trigger;
	}
}

```
