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

Add keywords to various blocks for easier discovery. #2336

Merged
merged 3 commits into from Aug 10, 2017
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
2 changes: 2 additions & 0 deletions blocks/library/cover-text/index.js
Expand Up @@ -27,6 +27,8 @@ registerBlockType( 'core/cover-text', {

category: 'formatting',

keywords: [ __( 'colors' ) ],

attributes: {
align: {
type: 'string',
Expand Down
14 changes: 13 additions & 1 deletion blocks/library/embed/index.js
Expand Up @@ -26,14 +26,16 @@ const { children } = source;
// These embeds do not work in sandboxes
const HOSTS_NO_PREVIEWS = [ 'facebook.com' ];

function getEmbedBlockSettings( { title, icon, category = 'embed', transforms } ) {
function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, keywords = [] } ) {
return {
title: __( title ),

icon,

category,

keywords,

attributes: {
url: {
type: 'string',
Expand Down Expand Up @@ -253,13 +255,15 @@ registerBlockType(
getEmbedBlockSettings( {
title: 'Twitter',
icon: 'twitter',
keywords: [ __( 'tweet' ) ],
} )
);
registerBlockType(
'core-embed/youtube',
getEmbedBlockSettings( {
title: 'YouTube',
icon: 'video-alt3',
keywords: [ __( 'music' ), __( 'video' ) ],
} )
);
registerBlockType(
Expand All @@ -274,41 +278,47 @@ registerBlockType(
getEmbedBlockSettings( {
title: 'Instagram',
icon: 'camera',
keywords: [ __( 'image' ) ],
} )
);
registerBlockType(
'core-embed/wordpress',
getEmbedBlockSettings( {
title: 'WordPress',
icon: 'wordpress',
keywords: [ __( 'post' ), __( 'blog' ) ],
} )
);
registerBlockType(
'core-embed/soundcloud',
getEmbedBlockSettings( {
title: 'SoundCloud',
icon: 'format-audio',
keywords: [ __( 'music' ), __( 'audio' ) ],
} )
);
registerBlockType(
'core-embed/spotify',
getEmbedBlockSettings( {
title: 'Spotify',
icon: 'format-audio',
keywords: [ __( 'music' ), __( 'audio' ) ],
} )
);
registerBlockType(
'core-embed/flickr',
getEmbedBlockSettings( {
title: 'Flickr',
icon: 'format-image',
keywords: [ __( 'image' ) ],
} )
);
registerBlockType(
'core-embed/vimeo',
getEmbedBlockSettings( {
title: 'Vimeo',
icon: 'video-alt3',
keywords: [ __( 'video' ) ],
} )
);

Expand Down Expand Up @@ -387,6 +397,7 @@ registerBlockType(
getEmbedBlockSettings( {
title: 'Mixcloud',
icon: 'format-audio',
keywords: [ __( 'music' ), __( 'audio' ) ],
} )
);
registerBlockType(
Expand Down Expand Up @@ -471,6 +482,7 @@ registerBlockType(
getEmbedBlockSettings( {
title: 'VideoPress',
icon: 'video-alt3',
keywords: [ __( 'video' ) ],
} )
);
registerBlockType(
Expand Down
1 change: 1 addition & 0 deletions blocks/library/gallery/index.js
Expand Up @@ -66,6 +66,7 @@ registerBlockType( 'core/gallery', {
title: __( 'Gallery' ),
icon: 'format-gallery',
category: 'common',
keywords: [ __( 'images' ), __( 'photos' ) ],

attributes: {
align: {
Expand Down
2 changes: 2 additions & 0 deletions blocks/library/heading/index.js
Expand Up @@ -25,6 +25,8 @@ registerBlockType( 'core/heading', {

category: 'common',

keywords: [ __( 'title' ), __( 'subtitle' ) ],

className: false,

attributes: {
Expand Down
2 changes: 2 additions & 0 deletions blocks/library/image/index.js
Expand Up @@ -35,6 +35,8 @@ registerBlockType( 'core/image', {

category: 'common',

keywords: [ __( 'photo' ) ],

attributes: {
url: {
type: 'string',
Expand Down
2 changes: 2 additions & 0 deletions blocks/library/latest-posts/index.js
Expand Up @@ -33,6 +33,8 @@ registerBlockType( 'core/latest-posts', {

category: 'widgets',

keywords: [ __( 'recent posts' ) ],

attributes: {
postsToShow: {
type: 'number',
Expand Down
1 change: 1 addition & 0 deletions blocks/library/list/index.js
Expand Up @@ -72,6 +72,7 @@ registerBlockType( 'core/list', {
title: __( 'List' ),
icon: 'editor-ul',
category: 'common',
keywords: [ __( 'bullet list' ), __( 'ordered list' ), __( 'numbered list' ) ],

attributes: {
nodeName: {
Expand Down
2 changes: 2 additions & 0 deletions blocks/library/separator/index.js
Expand Up @@ -16,6 +16,8 @@ registerBlockType( 'core/separator', {

category: 'layout',

keywords: [ __( 'horizontal-line' ), 'hr', __( 'divider' ) ],

transforms: {
from: [
{
Expand Down