Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed: Add Pinterest as an embed provider #34895

Merged
merged 1 commit into from Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -337,6 +338,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