Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks

Embed::get_provider_labelprivateWC 1.0

Get appropriate label for the provider.

Method of the class: Embed{}

No Hooks.

Returns

String. Label for the provider.

Usage

// private - for code of main (parent) class only
$result = $this->get_provider_label( $provider, $attr ): string;
$provider(string) (required)
Provider name.
$attr(array) (required)
Block attributes.

Embed::get_provider_label() code WC 10.9.4

private function get_provider_label( string $provider, array $attr ): string {
	// Use custom label if provided.
	if ( ! empty( $attr['label'] ) ) {
		return $attr['label'];
	}

	// Get translated label for the provider.
	return $this->get_translated_provider_label( $provider );
}