fix: render social links conditionally

This commit is contained in:
bisco
2026-06-26 00:04:43 +02:00
parent 36a686a988
commit c29a846918
4 changed files with 49 additions and 1 deletions
+12
View File
@@ -77,6 +77,18 @@ function azionelab_whatsapp_href( string $number ): string {
return preg_replace( '/[^0-9]/', '', $number ) ?: '';
}
function azionelab_social_icon( string $network ): string {
if ( 'instagram' === $network ) {
return '<svg class="social-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="4.5" y="4.5" width="15" height="15" rx="4.2" fill="none" stroke="currentColor" stroke-width="1.8"/><circle cx="12" cy="12" r="3.5" fill="none" stroke="currentColor" stroke-width="1.8"/><circle cx="16.8" cy="7.2" r="1.1" fill="currentColor"/></svg>';
}
if ( 'facebook' === $network ) {
return '<svg class="social-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path fill="currentColor" d="M14.2 8.4h2.3V5.1c-.4-.1-1.7-.2-3.1-.2-3.1 0-5.1 1.8-5.1 5.1v2.8H5v3.7h3.3V24h4.1v-7.5h3.3l.5-3.7h-3.8v-2.4c0-1.1.3-2 1.8-2Z"/></svg>';
}
return '';
}
function azionelab_setup(): void {
load_theme_textdomain( 'azionelab', get_template_directory() . '/languages' );
add_theme_support( 'title-tag' );