Home Forums ACF PRO ACF Blocks – How to send data to js?


ACF Blocks – How to send data to js?

    • Sridhar

    • September 21, 2020 at 12:31 pm

    I am trying out ACF Pro to build a custom carousel block and am looking to pass the user selected option’s value to the init js file.


    Something like this:

    var initializeBlock = function ($block) {
    		cellAlign: $value_selected_for_the_block,

    My current code is similar to

    Any idea?

    • Sridhar

    • September 21, 2020 at 3:22 pm

    Solved by sending the field value as a data attribute and accessing it in the JS file.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.