[wp-trac] [WordPress Trac] #60976: register_block_type not working with Oxygen

WordPress Trac noreply at wordpress.org
Wed Apr 10 11:26:00 UTC 2024


#60976: register_block_type not working with Oxygen
--------------------------+-----------------------------
 Reporter:  jfitatandem   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This is related to #59175 and [57675].

 Oxygen forces returns `get_template_directory()` to return a non valid
 path, `"fake"`.  Since the introduction of the call to `realpath` in
 [57675], `$template_paths_norm[ $template ]` is set with the empty string
 that results from `wp_normalize_path( realpath( get_template_directory() )
 )`.  That causes [[source:/trunk/src/wp-includes/blocks.php at 57675#L112|the
 next if condition]] to always match, no matter what path the asset is in,
 therefore calling `get_theme_file_uri` on all of them.

 Like in #59175, every block registered via `register_block_type` succeeds,
 but `editorScript` and `editorStyle` are not properly loaded in the editor
 because of the wrong—non existent—path.

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


More information about the wp-trac mailing list