Skip to content

Commit

Permalink
Adding Meta Threads icon as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Schaer committed Mar 4, 2024
1 parent 21fed7d commit 41dba3a
Show file tree
Hide file tree
Showing 13 changed files with 201 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,35 @@
],
"min": "",
"max": "1"
},
"layout_threads000003": {
"key": "layout_threads000003",
"name": "threads",
"label": "Threads",
"display": "block",
"sub_fields": [
{
"key": "field_threads000004",
"label": "Threads Name",
"name": "threads",
"type": "text",
"instructions": "Use @name",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
}
],
"min": "",
"max": "1"
}
},
"button_label": "Add Contact",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,33 @@
"min": "",
"max": "1"
},
"layout_threads0000001": {
"key": "layout_threads0000001",
"name": "threads",
"label": "Threads",
"display": "block",
"sub_fields": [
{
"key": "field_threads0000002",
"label": "Link to the Threads profile",
"name": "link",
"aria-label": "",
"type": "url",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": ""
}
],
"min": "",
"max": "1"
},
"layout_626bcda0bb4b4": {
"key": "layout_626bcda0bb4b4",
"name": "linkedin",
Expand Down
57 changes: 57 additions & 0 deletions wordpress/wp-content/themes/les-verts/acf-translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,33 @@
'min' => '',
'max' => '1',
),
'layout_threads0000001' => array(
'key' => 'layout_threads0000001',
'name' => 'threads',
'label' => __( 'Threads', 'lesverts' ),
'display' => 'block',
'sub_fields' => array(
array(
'key' => 'field_threads0000002',
'label' => __( 'Link to the threads profile', 'lesverts' ),
'name' => 'link',
'aria-label' => '',
'type' => 'url',
'instructions' => '',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
),
'min' => '',
'max' => '1',
),
'layout_5b6d680d1c8e3' => array(
'key' => 'layout_5b6d680d1c8e3',
'name' => 'tiktok',
Expand Down Expand Up @@ -6368,6 +6395,36 @@
'min' => '',
'max' => '1',
),
'layout_threads000003' => array(
'key' => 'layout_threads000003',
'name' => 'threads',
'label' => __( 'Threads', 'lesverts' ),
'display' => 'block',
'sub_fields' => array(
array(
'key' => 'field_threads000004',
'label' => __( 'Threads Name', 'lesverts' ),
'name' => 'threads',
'aria-label' => '',
'type' => 'text',
'instructions' => __( 'Use @name', 'lesverts' ),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
),
'min' => '',
'max' => '1',
),
),
'button_label' => __( 'Add Contact', 'lesverts' ),
'min' => '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
$base = 'https://www.instagram.com/';
$string = preg_replace( '/^(www)?\.instagram\.com\/?/', '', $string );
$string = str_replace( '@', '', $string );
} elseif ( 'threads' === $type ) {
$base = 'https://threads.net/';
$string = preg_replace( '/^(www)?\.threads\.net\/?/', '', $string );
$string = str_replace( '@', '', $string );
$string = "@" . $string;
} elseif ( 'mastodon' === $type ) {
if ( preg_match( '/^@(\S+)@(\S+)$/', $string, $matches ) ) {
$base = 'https://' . $matches[2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ context:
website: www.balthasar-glaettli.ch
facebook: https://www.facebook.com/wikipedia/
instagram: https://www.instagram.com/nasa/
threads: https://www.threads.net/@wikipedia
tiktok: https://www.tiktok.com/@wikipedia
bluesky: https://bsky.app/profile/wikipedia.bsky.social
variants:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
{{#if website}}<a href="http://{{website}}" class="m-person__contact m-person__contact--website">{{website}}</a>{{/if}}
</address>
<div class="m-person__social-media">
{{#if facebook}}<div class="m-person__social-icon">{{> @a-social-icon type='facebook' link=facebook}}</div>{{/if}}
{{#if bluesky}}<div class="m-person__social-icon">{{> @a-social-icon type='bluesky' link=bluesky}}</div>{{/if}}
{{#if tiktok}}<div class="m-person__social-icon">{{> @a-social-icon type='tiktok' link=tiktok}}</div>{{/if}}
{{#if bluesky}}<div class="m-person__social-icon">{{> @a-social-icon type='bluesky' link=bluesky}}bs</div>{{/if}}
{{#if twitter}}<div class="m-person__social-icon">{{> @a-social-icon type='twitter' link=twitter}}</div>{{/if}}
{{#if instagram}}<div class="m-person__social-icon">{{> @a-social-icon type='instagram' link=instagram}}</div>{{/if}}
{{#if threads}}<div class="m-person__social-icon">{{> @a-social-icon type='threads' link=threads}}</div>{{/if}}
{{#if facebook}}<div class="m-person__social-icon">{{> @a-social-icon type='facebook' link=facebook}}</div>{{/if}}
{{#if twitter}}<div class="m-person__social-icon">{{> @a-social-icon type='twitter' link=twitter}}</div>{{/if}}
</div>
{{/unless}}
</div>
Expand All @@ -38,11 +39,12 @@
{{#if website}}<a href="http://{{website}}" class="m-person__contact m-person__contact--website">{{website}}</a>{{/if}}
</address>
<div class="m-person__social-media">
{{#if facebook}}<div class="m-person__social-icon">{{> @a-social-icon type='facebook' link=facebook}}</div>{{/if}}
{{#if tiktok}}<div class="m-person__social-icon">{{> @a-social-icon type='tiktok' link=tiktok}}</div>{{/if}}
{{#if bluesky}}<div class="m-person__social-icon">{{> @a-social-icon type='bluesky' link=bluesky}}</div>{{/if}}
{{#if twitter}}<div class="m-person__social-icon">{{> @a-social-icon type='twitter' link=twitter}}</div>{{/if}}
{{#if tiktok}}<div class="m-person__social-icon">{{> @a-social-icon type='tiktok' link=tiktok}}</div>{{/if}}
{{#if instagram}}<div class="m-person__social-icon">{{> @a-social-icon type='instagram' link=instagram}}</div>{{/if}}
{{#if threads}}<div class="m-person__social-icon">{{> @a-social-icon type='threads' link=threads}}</div>{{/if}}
{{#if facebook}}<div class="m-person__social-icon">{{> @a-social-icon type='facebook' link=facebook}}</div>{{/if}}
{{#if twitter}}<div class="m-person__social-icon">{{> @a-social-icon type='twitter' link=twitter}}</div>{{/if}}
</div>
</div>
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ context:
- twitter
- linkedin
- instagram
- threads
- mail
- youtube
- mastodon
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
{% set link = link|social_link('tiktok') %}
{% elseif 'instagram' == type %}
{% set link = link|social_link('instagram') %}
{% elseif 'threads' == type %}
{% set link = link|social_link('threads') %}
{% elseif 'mastodon' == type %}
{% set link = link|social_link('mastodon') %}
{% elseif 'tumblr' == type %}
Expand Down
Loading

0 comments on commit 41dba3a

Please sign in to comment.