Skip to content

Commit

Permalink
Only register anchor attribute for dynamic blocks with render callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Soean committed Feb 20, 2023
1 parent a770a6e commit 3e99d5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/block-supports/anchor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
* @param WP_Block_Type $block_type Block Type.
*/
function gutenberg_register_anchor_support( $block_type ) {
if ( ! $block_type->render_callback ) {
return;
}

$has_anchor_support = _wp_array_get( $block_type->supports, array( 'anchor' ), true );
if ( ! $has_anchor_support ) {
return;
Expand Down

0 comments on commit 3e99d5f

Please sign in to comment.