WordPress at Your Fingertips
function is not described

woocommerce_blocks_get_php_translation_from_core() WC 1.0

Filter translations so we can retrieve translations from Core when the original and the translated texts are the same (which happens when translations are missing).

No Hooks.


String. WC Blocks translation. In case it's the same as $text, Core translation.


woocommerce_blocks_get_php_translation_from_core( $translation, $text, $domain );
$translation(string) (required)
Translated text based on WC Blocks translations.
$text(string) (required)
Text to translate.
$domain(string) (required)
The text domain.

Code of woocommerce_blocks_get_php_translation_from_core() WC 5.6.0

function woocommerce_blocks_get_php_translation_from_core( $translation, $text, $domain ) {
	if ( 'woo-gutenberg-products-block' !== $domain ) {
		return $translation;

	// When translation is the same, that could mean the string is not translated.
	// In that case, load it from core.
	if ( $translation === $text ) {
		return translate( $text, 'woocommerce' ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction, WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.TextDomainMismatch
	return $translation;