Site logo

Archived topic

themedomain replacement in PHP

5 replies · Started by Ree on September 21, 2021

Viewing posts 1–6 of 6

$fields['shipping']['shipping_first_name']['placeholder'] = __('姓名', 'themedomain');

I am using Generatepress child theme, what should i replace themedomain be?

Hi Ree,

To match its GP's default textdomain, use generatepress. :D

Example:
$fields['shipping']['shipping_first_name']['placeholder'] = __('姓名', 'generatepress');

thank you!

No problem. :D

add_filter( 'woocommerce_checkout_fields', 'customize_woo_checkout_fields' );
function customize_woo_checkout_fields( $fields ) {
	unset( $fields['shipping']['shipping_last_name'] );
$fields['shipping']['shipping_first_name']['placeholder'] = __('姓名', 'generatepress');
$fields['shipping']['shipping_first_name']['label'] = __('姓名', 'generatepress');
unset( $fields['billing']['billing_last_name'] );
$fields['billing']['billing_first_name']['placeholder'] = __('姓名', 'generatepress');
$fields['billing']['billing_first_name']['label'] = __('姓名', 'generatepress');
    return $fields;
}

I tried this code but for a particular “價格” string, I have tried various methods but none of them worked, then I deactivated child theme and activated the parent theme (generatepress) and then it shows correct translation.

Is my coding correct?

Hi there,

as its the Woocommerce filter you should use their text domain which is: woocommerce

This archived topic is closed to new replies.