[wp-trac] [WordPress Trac] #59175: register_block_type is not working with symbolic links

WordPress Trac noreply at wordpress.org
Wed Aug 23 14:55:16 UTC 2023


#59175: register_block_type is not working with symbolic links
--------------------------+-----------------------------
 Reporter:  antonlukin    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I try to register new block inside functions.php of my theme with
 register_block_type( __DIR__ . '/build/speech' ); function.
 block.json is located inside './build/speech' directory.

 The block registered correctly, but files editorScript and editorStyle
 can't enqueue because of the symlinks problem.

 `$is_theme_block` variable set to false while
 `$style_path_norm` points to
 `/srv/http/kedr.media/theme/public/blocks/build/help/index.css`
 `$template_path_norm` points to `/srv/http/kedr.media/wordpress/wp-
 content/themes/kedr`

 https://github.com/WordPress/WordPress/blob/106404bcbd2e8c19947b64691dd2dbadf0f02a47
 /wp-includes/blocks.php#L272

 My theme is physically located on `/srv/http/kedr.media/theme/public/`
 path, but WordPress core on `/srv/http/kedr.media/wordpress/`

 This doesn't seem to be the best way to check if a block is part of a
 theme.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59175>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list