Skip to content

Commit

Permalink
Add Pinterest as an embed provider. (#34895)
Browse files Browse the repository at this point in the history
  • Loading branch information
pento committed Oct 8, 2021
1 parent ed8a5c8 commit 23f943b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/block-library/src/embed/icons.js
Expand Up @@ -142,3 +142,8 @@ export const embedDailymotionIcon = (
/>
</SVG>
);
export const embedPinterestIcon = (
<SVG width="24" height="24" viewBox="0 0 24 24" version="1.1">
<Path d="M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2" />
</SVG>
);
12 changes: 12 additions & 0 deletions packages/block-library/src/embed/variations.js
Expand Up @@ -24,6 +24,7 @@ import {
embedAmazonIcon,
embedAnimotoIcon,
embedDailymotionIcon,
embedPinterestIcon,
} from './icons';

/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
Expand Down Expand Up @@ -329,6 +330,17 @@ const variations = [
],
attributes: { providerNameSlug: 'amazon-kindle' },
},
{
name: 'pinterest',
title: 'Pinterest',
icon: embedPinterestIcon,
keywords: [ __( 'social' ), __( 'bookmark' ) ],
description: __( 'Embed Pinterest pins, boards, and profiles.' ),
patterns: [
/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i,
],
attributes: { providerNameSlug: 'pinterest' },
},
];

/**
Expand Down

0 comments on commit 23f943b

Please sign in to comment.