Skip to content

Commit

Permalink
Improve consistency of block names (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
nylen committed Jun 30, 2017
1 parent 3c8ea7e commit 9a5ee49
Show file tree
Hide file tree
Showing 329 changed files with 1,216 additions and 1,007 deletions.
279 changes: 244 additions & 35 deletions blocks/library/embed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,38 +211,247 @@ function getEmbedBlockSettings( { title, icon, category = 'embed' } ) {
};
}

registerBlockType( 'core/embed', getEmbedBlockSettings( { title: 'Embed', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedanimoto', getEmbedBlockSettings( { title: 'Animoto', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedcloudup', getEmbedBlockSettings( { title: 'Cloudup', icon: 'cloud' } ) );
registerBlockType( 'core/embedcollegehumor', getEmbedBlockSettings( { title: 'CollegeHumor', icon: 'video-alt3' } ) );
registerBlockType( 'core/embeddailymotion', getEmbedBlockSettings( { title: 'Dailymotion', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedfacebook', getEmbedBlockSettings( { title: 'Facebook', icon: 'facebook' } ) );
registerBlockType( 'core/embedflickr', getEmbedBlockSettings( { title: 'Flickr', icon: 'format-image' } ) );
registerBlockType( 'core/embedfunnyordie', getEmbedBlockSettings( { title: 'Funny or Die', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedhulu', getEmbedBlockSettings( { title: 'Hulu', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedimgur', getEmbedBlockSettings( { title: 'Imgur', icon: 'format-image' } ) );
registerBlockType( 'core/embedinstagram', getEmbedBlockSettings( { title: 'Instagram', icon: 'camera' } ) );
registerBlockType( 'core/embedissuu', getEmbedBlockSettings( { title: 'Issuu', icon: 'media-default' } ) );
registerBlockType( 'core/embedkickstarter', getEmbedBlockSettings( { title: 'Kickstarter', icon: 'lightbulb' } ) );
registerBlockType( 'core/embedmeetupcom', getEmbedBlockSettings( { title: 'Meetup.com', icon: 'location-alt' } ) );
registerBlockType( 'core/embedmixcloud', getEmbedBlockSettings( { title: 'Mixcloud', icon: 'format-audio' } ) );
registerBlockType( 'core/embedphotobucket', getEmbedBlockSettings( { title: 'Photobucket', icon: 'camera' } ) );
registerBlockType( 'core/embedpolldaddy', getEmbedBlockSettings( { title: 'Polldaddy', icon: 'yes' } ) );
registerBlockType( 'core/embedreddit', getEmbedBlockSettings( { title: 'Reddit', icon: 'share' } ) );
registerBlockType( 'core/embedreverbnation', getEmbedBlockSettings( { title: 'ReverbNation', icon: 'format-audio' } ) );
registerBlockType( 'core/embedscreencast', getEmbedBlockSettings( { title: 'Screencast', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedscribd', getEmbedBlockSettings( { title: 'Scribd', icon: 'book-alt' } ) );
registerBlockType( 'core/embedslideshare', getEmbedBlockSettings( { title: 'Slideshare', icon: 'slides' } ) );
registerBlockType( 'core/embedsmugmug', getEmbedBlockSettings( { title: 'SmugMug', icon: 'camera' } ) );
registerBlockType( 'core/embedsoundcloud', getEmbedBlockSettings( { title: 'SoundCloud', icon: 'format-audio' } ) );
registerBlockType( 'core/embedspeaker', getEmbedBlockSettings( { title: 'Speaker', icon: 'format-audio' } ) );
registerBlockType( 'core/embedspotify', getEmbedBlockSettings( { title: 'Spotify', icon: 'format-audio' } ) );
registerBlockType( 'core/embedted', getEmbedBlockSettings( { title: 'TED', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedtumblr', getEmbedBlockSettings( { title: 'Tumblr', icon: 'share' } ) );
registerBlockType( 'core/embedtwitter', getEmbedBlockSettings( { title: 'Twitter', icon: 'twitter' } ) );
registerBlockType( 'core/embedvideopress', getEmbedBlockSettings( { title: 'VideoPress', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedvimeo', getEmbedBlockSettings( { title: 'Vimeo', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedvine', getEmbedBlockSettings( { title: 'Vine', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedwordpress', getEmbedBlockSettings( { title: 'WordPress', icon: 'wordpress' } ) );
registerBlockType( 'core/embedwordpresstv', getEmbedBlockSettings( { title: 'WordPress.tv', icon: 'video-alt3' } ) );
registerBlockType( 'core/embedyoutube', getEmbedBlockSettings( { title: 'YouTube', icon: 'video-alt3' } ) );
registerBlockType(
'core/embed',
getEmbedBlockSettings( {
title: 'Embed',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/animoto',
getEmbedBlockSettings( {
title: 'Animoto',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/cloudup',
getEmbedBlockSettings( {
title: 'Cloudup',
icon: 'cloud',
} )
);
registerBlockType(
'core-embed/collegehumor',
getEmbedBlockSettings( {
title: 'CollegeHumor',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/dailymotion',
getEmbedBlockSettings( {
title: 'Dailymotion',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/facebook',
getEmbedBlockSettings( {
title: 'Facebook',
icon: 'facebook',
} )
);
registerBlockType(
'core-embed/flickr',
getEmbedBlockSettings( {
title: 'Flickr',
icon: 'format-image',
} )
);
registerBlockType(
'core-embed/funnyordie',
getEmbedBlockSettings( {
title: 'Funny or Die',
icon: 'video-alt3',
} ) );
registerBlockType(
'core-embed/hulu',
getEmbedBlockSettings( {
title: 'Hulu',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/imgur',
getEmbedBlockSettings( {
title: 'Imgur',
icon: 'format-image',
} )
);
registerBlockType(
'core-embed/instagram',
getEmbedBlockSettings( {
title: 'Instagram',
icon: 'camera',
} )
);
registerBlockType(
'core-embed/issuu',
getEmbedBlockSettings( {
title: 'Issuu',
icon: 'media-default',
} )
);
registerBlockType(
'core-embed/kickstarter',
getEmbedBlockSettings( {
title: 'Kickstarter',
icon: 'lightbulb',
} )
);
registerBlockType(
'core-embed/meetup-com',
getEmbedBlockSettings( {
title: 'Meetup.com',
icon: 'location-alt',
} )
);
registerBlockType(
'core-embed/mixcloud',
getEmbedBlockSettings( {
title: 'Mixcloud',
icon: 'format-audio',
} )
);
registerBlockType(
'core-embed/photobucket',
getEmbedBlockSettings( {
title: 'Photobucket',
icon: 'camera',
} )
);
registerBlockType(
'core-embed/polldaddy',
getEmbedBlockSettings( {
title: 'Polldaddy',
icon: 'yes',
} )
);
registerBlockType(
'core-embed/reddit',
getEmbedBlockSettings( {
title: 'Reddit',
icon: 'share',
} )
);
registerBlockType(
'core-embed/reverbnation',
getEmbedBlockSettings( {
title: 'ReverbNation',
icon: 'format-audio',
} )
);
registerBlockType(
'core-embed/screencast',
getEmbedBlockSettings( {
title: 'Screencast',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/scribd',
getEmbedBlockSettings( {
title: 'Scribd',
icon: 'book-alt',
} )
);
registerBlockType(
'core-embed/slideshare',
getEmbedBlockSettings( {
title: 'Slideshare',
icon: 'slides',
} )
);
registerBlockType(
'core-embed/smugmug',
getEmbedBlockSettings( {
title: 'SmugMug',
icon: 'camera',
} )
);
registerBlockType(
'core-embed/soundcloud',
getEmbedBlockSettings( {
title: 'SoundCloud',
icon: 'format-audio',
} )
);
registerBlockType(
'core-embed/speaker',
getEmbedBlockSettings( {
title: 'Speaker',
icon: 'format-audio',
} )
);
registerBlockType(
'core-embed/spotify',
getEmbedBlockSettings( {
title: 'Spotify',
icon: 'format-audio',
} )
);
registerBlockType(
'core-embed/ted',
getEmbedBlockSettings( {
title: 'TED',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/tumblr',
getEmbedBlockSettings( {
title: 'Tumblr',
icon: 'share',
} )
);
registerBlockType(
'core-embed/twitter',
getEmbedBlockSettings( {
title: 'Twitter',
icon: 'twitter',
} )
);
registerBlockType(
'core-embed/videopress',
getEmbedBlockSettings( {
title: 'VideoPress',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/vimeo',
getEmbedBlockSettings( {
title: 'Vimeo',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/vine',
getEmbedBlockSettings( {
title: 'Vine',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/wordpress',
getEmbedBlockSettings( {
title: 'WordPress',
icon: 'wordpress',
} )
);
registerBlockType(
'core-embed/wordpress-tv',
getEmbedBlockSettings( {
title: 'WordPress.tv',
icon: 'video-alt3',
} )
);
registerBlockType(
'core-embed/youtube',
getEmbedBlockSettings( {
title: 'YouTube',
icon: 'video-alt3',
} )
);
18 changes: 9 additions & 9 deletions blocks/library/latest-posts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import ToggleControl from '../../inspector-controls/toggle-control';
const MIN_POSTS = 1;
const MAX_POSTS = 100;

registerBlockType( 'core/latestposts', {
registerBlockType( 'core/latest-posts', {
title: __( 'Latest Posts' ),

icon: 'list-view',

category: 'widgets',

defaultAttributes: {
poststoshow: 5,
postsToShow: 5,
displayPostDate: false,
},

Expand All @@ -36,13 +36,13 @@ registerBlockType( 'core/latestposts', {
super( ...arguments );
this.changePostsToShow = this.changePostsToShow.bind( this );

const { poststoshow } = this.props.attributes;
const { postsToShow } = this.props.attributes;

this.state = {
latestPosts: [],
};

this.latestPostsRequest = getLatestPosts( poststoshow );
this.latestPostsRequest = getLatestPosts( postsToShow );

this.latestPostsRequest
.then( latestPosts => this.setState( { latestPosts } ) );
Expand All @@ -58,8 +58,8 @@ registerBlockType( 'core/latestposts', {
}

componentWillReceiveProps( nextProps ) {
const { poststoshow: postToShowCurrent } = this.props.attributes;
const { poststoshow: postToShowNext } = nextProps.attributes;
const { postsToShow: postToShowCurrent } = this.props.attributes;
const { postsToShow: postToShowNext } = nextProps.attributes;
const { setAttributes } = this.props;

if ( postToShowCurrent === postToShowNext ) {
Expand All @@ -72,14 +72,14 @@ registerBlockType( 'core/latestposts', {
this.latestPostsRequest
.then( latestPosts => this.setState( { latestPosts } ) );

setAttributes( { poststoshow: postToShowNext } );
setAttributes( { postsToShow: postToShowNext } );
}
}

changePostsToShow( postsToShow ) {
const { setAttributes } = this.props;

setAttributes( { poststoshow: parseInt( postsToShow, 10 ) || 0 } );
setAttributes( { postsToShow: parseInt( postsToShow, 10 ) || 0 } );
}

render() {
Expand Down Expand Up @@ -111,7 +111,7 @@ registerBlockType( 'core/latestposts', {
type="number"
min={ MIN_POSTS }
max={ MAX_POSTS }
value={ this.props.attributes.poststoshow }
value={ this.props.attributes.postsToShow }
onChange={ ( value ) => this.changePostsToShow( value ) }
/>
</InspectorControls>
Expand Down
4 changes: 2 additions & 2 deletions blocks/library/latest-posts/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
div[data-type="core/latestposts"] .wp-block-latestposts {
div[data-type="core/latest-posts"] .wp-block-latest-posts {
padding-left: 2.5em;
}

.wp-block-latestposts__post-date {
.wp-block-latest-posts__post-date {
display: block;
color: $dark-gray-100;
font-size: $default-font-size;
Expand Down
Loading

0 comments on commit 9a5ee49

Please sign in to comment.