Skip to content

Commit

Permalink
Add a filter for the reusable block id
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceOnTheGo authored and andreasciamanna committed Oct 26, 2018
1 parent a696e50 commit 603b0d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-library/src/block/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function render_block_core_block( $attributes ) {
return '';
}

$reusable_block = get_post( $attributes['ref'] );
$reusable_block_id = apply_filters( 'gutenberg_reusable_block_id', $attributes['ref'] );
$reusable_block = get_post( $reusable_block_id );
if ( ! $reusable_block || 'wp_block' !== $reusable_block->post_type ) {
return '';
}
Expand Down

0 comments on commit 603b0d0

Please sign in to comment.