Opened 4 months ago
Last modified 2 months ago
#59175 new defect (bug)
register_block_type is not working with symbolic links
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | has-patch |
Focuses: | Cc: |
Description
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
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.
Change History (6)
This ticket was mentioned in PR #5460 on WordPress/wordpress-develop by @spacedmonkey.
2 months ago
#2
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/59175
@antonlukin There are been changes to the block registration process in WP 6.4. It is possible that you could test the latest beta to see if that fixes the issue.