Opened 8 years ago
Closed 8 years ago
#45219 closed defect (bug) (invalid)
In Gutenberg in WordPress 5 beta wp.editor does not exists
| Reported by: | michielve | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Editor | Version: | 5.0 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
When I try to call var RichText = wp.editor.RichText I get an error, because wp.editor is undefined. In the Gutenberg plugin this did work.
Change History (3)
#2
@
8 years ago
Now I see why it didn't work. I used wp-cli to generate the block files and I saw that it generated the following code:
wp_register_script( 'myblock-block-editor', plugins_url( $index_js, __FILE__ ), array( 'wp-blocks', 'wp-i18n', 'wp-element', ), filemtime( "$dir/$index_js" ) );
So without a 'wp-editor' dependency. Once I added it it worked. Thanks and sorry to bother you with this.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
How are you calling this in your plugin? How are you enqueueing your JS?
When I evaluate
wp.editor.RichTextin the browser console it works just fine, with or without the plugin.