Skip to content

Commit

Permalink
Add isSharedBlock as a deprecated alias of isSavedBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Jul 23, 2018
1 parent 6bf1ce0 commit ded10a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/blocks/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export {
getBlockTypes,
getBlockSupport,
hasBlockSupport,
isSharedBlock,
isSavedBlock,
getChildBlockNames,
hasChildBlocks,
Expand Down
10 changes: 10 additions & 0 deletions packages/blocks/src/api/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { get, isFunction, some } from 'lodash';
*/
import { applyFilters } from '@wordpress/hooks';
import { select, dispatch } from '@wordpress/data';
import deprecated from '@wordpress/deprecated';

/**
* Internal dependencies
Expand Down Expand Up @@ -296,6 +297,15 @@ export function hasBlockSupport( nameOrType, feature, defaultSupports ) {
return !! getBlockSupport( nameOrType, feature, defaultSupports );
}

export function isSharedBlock( blockOrType ) {
deprecated( 'wp.blocks.isSharedBlock', {
version: 3.6,
alternative: 'wp.blocks.isSavedBlock',
plugin: 'Gutenberg',
} );
return isSavedBlock( blockOrType );
}

/**
* Determines whether or not the given block is a saved block. This is a
* special block type that is used to point to a global block stored via the
Expand Down

0 comments on commit ded10a6

Please sign in to comment.