Custom Fields
Support MB Blocks How can I use the custom asset callback to render a block properly?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
  • #24478
    Long Nguyen

    Hi Cristian,

    You can put all JS code to the file certificaciones.js to enqueue for this block or use the code to enqueue more JS files. Follow this document

    Cristian A.

    Hi Long, Thank you for your help.
    I was reading the documentation and I tried to use some custom assets on the block render area (using the AIO plugin) I can’t get it work correctly.

    Block render settings

    When I did a preview of the code I saw that the functions() is displaying as a string and not outside of that string to call more assets.

    Code preview

    Do you have some ideas that can I use to solve that?

    Thank you

    Long Nguyen


    To use the custom assets in the Builder, you need to add your function code to the file functions.php in the theme/child theme folder.


    function my_callback() {
        wp_enqueue_script( 'my-script', 'link-to-js-file', [ 'jquery' ], '', true );

    then add the function name to Custom assets callback input. Screenshot

    Cristian A.

    Thank you very much

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