Giter VIP home page Giter VIP logo

Comments (2)

colorcube avatar colorcube commented on June 27, 2024 1

I found the problem.
I used wp_cli scaffolding for my custom gutenberg block, like:

wp-cli.phar scaffold block my-custom

In the generated code there's a function to register the block JavaScript with wp_register_script(). So far so good.

But the function will be called with this hook:

add_action('init', 'my_custom_block_init');

gutenberg-fields-middleware uses the hook 'enqueue_block_editor_assets' which seems to be called later.

I changed my hook registration to

add_action('enqueue_block_editor_assets', 'my_custom_block_init');

and everything works fine.

from gutenberg-fields-middleware.

mohdsayed avatar mohdsayed commented on June 27, 2024

Thanks for trying @colorcube , I just tested with WordPress 5.0.2 however wasn't able to replicate the error. Would you be able to give me steps to produce this error?
You may also take a look at https://github.com/rtCamp/gutenberg-supplements which is created with Gutenberg Fields Middleware for reference.

from gutenberg-fields-middleware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.