[Resolved] how to insert a hook between blocks

Home Forums Support [Resolved] how to insert a hook between blocks

Home Forums Support how to insert a hook between blocks

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1408227
    detanatar

    How do I insert my own code (hook elements) between two Gutenberg constructor blocks?

    #1408342
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can’t hook an Element into your existing content between blocks, unfortunately. Hooks only work where the code for the hooks exist, and that code can’t exist inside the content you build.

    Let me know if you need more info 🙂

    #1408861
    detanatar

    Maybe there is an opportunity to include in the new version of gp-premium some code that I can add myself to an arbitrary place, the body of the WordPress page (by the Gutenberg block) (by the editor of the page, post, product)? And this code will output a hook?

    #1409164
    David
    Staff
    Customer Support

    Hi there,

    there is a hacky way around this.
    See this topic:

    https://generatepress.com/forums/topic/hook/#post-1036765

    #1409792
    detanatar

    Thanks It works

    #1410167
    David
    Staff
    Customer Support

    You’re welcome

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.