Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assets/social/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/blocks/icon/svgs/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/blocks/share/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"customTextColor": {
"type": "string"
},
"twitter": {
"x": {
"type": "boolean",
"default": true
},
Expand Down
14 changes: 7 additions & 7 deletions src/blocks/share/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function coblocks_render_coblocks_social_block( $attributes ) {
&title=' . get_the_title() . '
';

// Generate the Twitter URL.
$twitter_url = '
http://twitter.com/share?
// Generate the x URL.
$x_url = '
http://x.com/share?
text=' . get_the_title() . '
&url=' . get_the_permalink() . '
';
Expand Down Expand Up @@ -83,7 +83,7 @@ function coblocks_render_coblocks_social_block( $attributes ) {

// Apply filters, so that the social URLs can be modified.
$facebook_url = apply_filters( 'coblocks_facebook_share_url', $facebook_url );
$twitter_url = apply_filters( 'coblocks_twitter_share_url', $twitter_url );
$x_url = apply_filters( 'coblocks_x_share_url', $x_url );
$pinterest_url = apply_filters( 'coblocks_pinterest_share_url', $pinterest_url );
$linkedin_url = apply_filters( 'coblocks_linkedin_share_url', $linkedin_url );
$email_url = apply_filters( 'coblocks_email_share_url', $email_url );
Expand Down Expand Up @@ -133,9 +133,9 @@ function coblocks_render_coblocks_social_block( $attributes ) {
'text' => esc_html__( 'Share on Facebook', 'coblocks' ),
'url' => $facebook_url,
),
'twitter' => array(
'text' => esc_html__( 'Share on Twitter', 'coblocks' ),
'url' => $twitter_url,
'x' => array(
'text' => esc_html__( 'Share on x', 'coblocks' ),
'url' => $x_url,
),
'pinterest' => array(
'text' => esc_html__( 'Share on Pinterest', 'coblocks' ),
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/share/styles/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Supported icons.
$icons:
(twitter, #55acee),
(x, #000000),
(facebook, #3b5999),
(pinterest, #e60023),
(linkedin, #0077b5),
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/social-profiles/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"type": "string",
"default": ""
},
"twitter": {
"x": {
"type": "string",
"default": ""
},
Expand Down
12 changes: 6 additions & 6 deletions src/blocks/social-profiles/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const SocialProfilesEdit = ( props ) => {
size,
textAlign,
tiktok,
twitter,
x,
yelp,
youtube,
} = attributes;
Expand Down Expand Up @@ -125,10 +125,10 @@ const SocialProfilesEdit = ( props ) => {
ariaLabel: __( 'Add Facebook profile', 'coblocks' ),
},
{
slug: 'twitter',
name: __( 'Twitter', 'coblocks' ),
placeholder: __( 'https://twitter.com/', 'coblocks' ),
ariaLabel: __( 'Add Twitter profile', 'coblocks' ),
slug: 'x',
name: __( 'X', 'coblocks' ),
placeholder: __( 'https://x.com/', 'coblocks' ),
ariaLabel: __( 'Add X profile', 'coblocks' ),
},
{
slug: 'instagram',
Expand Down Expand Up @@ -176,7 +176,7 @@ const SocialProfilesEdit = ( props ) => {

const placeholder = ! (
facebook ||
twitter ||
x ||
instagram ||
tiktok ||
pinterest ||
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/social-profiles/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function coblocks_render_coblocks_social_profiles_block( $attributes ) {
// Supported social media platforms.
$platforms = array(
'facebook' => __( 'Facebook', 'coblocks' ),
'twitter' => __( 'Twitter', 'coblocks' ),
'x' => __( 'X', 'coblocks' ),
'instagram' => __( 'Instagram', 'coblocks' ),
'tiktok' => __( 'TikTok', 'coblocks' ),
'pinterest' => __( 'Pinterest', 'coblocks' ),
Expand Down
8 changes: 4 additions & 4 deletions src/blocks/social-profiles/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Inspector = ( props ) => {
iconSize,
padding,
facebook,
twitter,
x,
instagram,
tiktok,
pinterest,
Expand Down Expand Up @@ -171,9 +171,9 @@ const Inspector = ( props ) => {
onChange={ ( value ) => setAttributes( { facebook: escape( value ) } ) }
/>
<TextControl
label="Twitter"
value={ twitter }
onChange={ ( value ) => setAttributes( { twitter: escape( value ) } ) }
label="X (formerly Twitter)"
value={ x }
onChange={ ( value ) => setAttributes( { x: escape( value ) } ) }
/>
<TextControl
label="Instagram"
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/social-profiles/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const transforms = {
return createBlock( 'coblocks/social', {
...attributes,
facebook: getPreviousAttributes( 'share', 'facebook', attributes ),
twitter: getPreviousAttributes( 'share', 'twitter', attributes ),
x: getPreviousAttributes( 'share', 'x', attributes ),
pinterest: getPreviousAttributes( 'share', 'pinterest', attributes ),
linkedin: getPreviousAttributes( 'share', 'linkedin', attributes ),
email: getPreviousAttributes( 'share', 'email', attributes ),
Expand All @@ -76,9 +76,9 @@ export const transforms = {
'facebook',
attributes
),
twitter: getPreviousAttributes(
x: getPreviousAttributes(
'social-profiles',
'twitter',
'x',
attributes
),
pinterest: getPreviousAttributes(
Expand Down