Changeset 3211834 for cyr2lat/trunk/src/php/ErrorHandler.php
- Timestamp:
- 12/22/2024 02:04:21 PM (15 months ago)
- File:
-
- 1 edited
-
cyr2lat/trunk/src/php/ErrorHandler.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cyr2lat/trunk/src/php/ErrorHandler.php
r3189796 r3211834 39 39 add_action( 'doing_it_wrong_run', [ $this, 'action_doing_it_wrong_run' ], 20, 3 ); 40 40 add_filter( 'doing_it_wrong_trigger_error', [ $this, 'filter_doing_it_wrong_trigger_error' ], 10, 4 ); 41 }42 43 // Fix WP 6.5+ translation error.44 if ( version_compare( $GLOBALS['wp_version'], '6.5', '>=' ) ) {45 add_filter( 'gettext', [ $this, 'filter_gettext' ], 10, 3 );46 41 } 47 42 } … … 110 105 111 106 /** 112 * Filter for gettext.113 *114 * @param string|mixed $translation Translated text.115 * @param string|mixed $text Text to translate.116 * @param string|mixed $domain Text domain. Unique identifier for retrieving translated strings.117 *118 * @return string119 */120 public function filter_gettext( $translation, $text, $domain ): string {121 122 $translation = (string) $translation;123 $text = (string) $text;124 $domain = (string) $domain;125 126 if ( '' === $translation && 'cyr2lat' === $domain ) {127 $translation = $text;128 }129 130 return $translation;131 }132 133 /**134 107 * Whether it is the just_in_time_error for plugin-related domain. 135 108 *
Note: See TracChangeset
for help on using the changeset viewer.