-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #722 from WordPress/fix/713-default-textdomain-war…
…ning Modifies i18n_usage check to consider explicit default textdomain usage a warning
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
22 changes: 22 additions & 0 deletions
22
tests/phpunit/testdata/plugins/test-plugin-i18n-usage-with-default/load.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* Plugin Name: Test Plugin i18n usage with default for Plugin Check | ||
* Plugin URI: https://github.com/WordPress/plugin-check | ||
* Description: Some plugin description. | ||
* Requires at least: 6.0 | ||
* Requires PHP: 5.6 | ||
* Version: 1.0.0 | ||
* Author: WordPress Performance Team | ||
* Author URI: https://make.wordpress.org/performance/ | ||
* License: GPLv2 or later | ||
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html | ||
* Text Domain: test-plugin-i18n-usage-without-errors | ||
* | ||
* @package test-plugin-check | ||
*/ | ||
|
||
// This explicitly uses the 'default' WordPress Core text domain which should cause a warning. | ||
esc_html__( 'Log In', 'default' ); | ||
|
||
// This omits the text domain though, which will lead to the same behavior but is not allowed and thus an error. | ||
esc_html__( 'Log In' ); |
This file contains 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