Automattic\WooCommerce\Internal\ProductCustoms

ClassicEditorFields::get_help_text │ private │ WC 1.0

Appends the inherited parent value to a field's help text, when there is one.

Method of the class: ClassicEditorFields{}

No Hooks.

Returns

string.

Usage

// private - for code of main (parent) class only
$result = $this->get_help_text( $description, ?string $inherited ): string;
$description(string) (required)
Field help text.
?string $inherited(required)
.

ClassicEditorFields::get_help_text() code WC 11.3.0

private function get_help_text( string $description, ?string $inherited ): string {
	if ( null === $inherited ) {
		return $description;
	}

	/* translators: %s: Customs value inherited from the parent product. */
	return $description . ' ' . sprintf( __( 'Leave blank to inherit from the product: %s.', 'woocommerce' ), $inherited );
}