astra_logo_svg_icon()

Provides the logo svg icon according to the user’s selection.


Description


Return

(string)


Source

File: inc/markup-extras.php

function astra_logo_svg_icon() {

	if ( ! apply_filters( 'astra_enable_logo_svg_icon', astra_get_option( 'use-logo-svg-icon' ) ) ) {
		return '';
	}

	if ( has_custom_logo() ) {
		return '';
	}

	$logo_svg_code = '';
	$logo_svg_icon = astra_get_option( 'logo-svg-icon' );

	if ( ! isset( $logo_svg_icon['value'] ) ) {
		return $logo_svg_code;
	}

	switch ( $logo_svg_icon['type'] ) {
		case 'icon-library':
			$svg_icons = function_exists( 'astra_get_logo_svg_icons_array' ) ? astra_get_logo_svg_icons_array() : array();

			if ( ! empty( $svg_icons[ $logo_svg_icon['value'] ] ) ) {
				$logo_svg_code = $svg_icons[ $logo_svg_icon['value'] ]['rendered'];
			}
			break;

		case 'custom':
			$logo_svg_code = $logo_svg_icon['value'];
			break;

		default:
			$logo_svg_code = '';
			break;
	}

	return $logo_svg_code;
}

Changelog

Changelog
Version Description
4.7.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.