Automattic\WooCommerce\Blocks\BlockTypes

CustomerAccount::render_icon()privateWC 1.0

Gets the icon to render depending on the iconStyle and displayStyle.

Метод класса: CustomerAccount{}

Хуков нет.

Возвращает

Строку. Label to render on the block

Использование

// private - только в коде основоного (родительского) класса
$result = $this->render_icon( $attributes );
$attributes(массив) (обязательный)
Block attributes.

Код CustomerAccount::render_icon() WC 8.7.0

private function render_icon( $attributes ) {
	if ( self::TEXT_ONLY === $attributes['displayStyle'] ) {
		return '';
	}

	if ( self::DISPLAY_ALT === $attributes['iconStyle'] ) {
		return '<svg class="' . $attributes['iconClass'] . '" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18">
			<path
				d="M9 0C4.03579 0 0 4.03579 0 9C0 13.9642 4.03579 18 9 18C13.9642 18 18 13.9642 18 9C18 4.03579 13.9642 0 9
				 	0ZM9 4.32C10.5347 4.32 11.7664 5.57056 11.7664 7.08638C11.7664 8.62109 10.5158 9.85277 9 9.85277C7.4653
				 	9.85277 6.23362 8.60221 6.23362 7.08638C6.23362 5.57056 7.46526 4.32 9 4.32ZM9 10.7242C11.1221 10.7242
				  	12.96 12.2021 13.7937 14.4189C12.5242 15.5559 10.8379 16.238 9 16.238C7.16207 16.238 5.49474 15.5369
				   	4.20632 14.4189C5.05891 12.2021 6.87793 10.7242 9 10.7242Z"
				fill="currentColor"
			/>
		</svg>';
	}

	return '<svg class="' . $attributes['iconClass'] . '" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
		<path
			d="M8.00009 8.34785C10.3096 8.34785 12.1819 6.47909 12.1819 4.17393C12.1819 1.86876 10.3096 0 8.00009 0C5.69055
			 	0 3.81824 1.86876 3.81824 4.17393C3.81824 6.47909 5.69055 8.34785 8.00009 8.34785ZM0.333496 15.6522C0.333496
			  	15.8444 0.489412 16 0.681933 16H15.3184C15.5109 16 15.6668 15.8444 15.6668 15.6522V14.9565C15.6668 12.1428
			   	13.7821 9.73911 10.0912 9.73911H5.90931C2.21828 9.73911 0.333645 12.1428 0.333645 14.9565L0.333496 15.6522Z"
			fill="currentColor"
		/>
	</svg>';
}