Home › Forums › Gutenberg › Get data from block in different page › Reply To: Get data from block in different page
@ignitionmedia82 I had two replies on this thread above. In my first reply, the custom_get_acf_block_ids_from_post()
function gives an example of getting the block id(s) from your page so that you can use it as your selector. You could query for all blocks and then loop through the results looking for any testimonial blocks, or pass the block type(s) as an array of what you want to filter by. Combine those results with the get_field_from_block()
function from my 2nd reply and you should be good to go, I believe.
edit: realized I may have misunderstood your question. Do you mean the actual $selector parameter? That’s the name of your ACF field, the same as if you were using get_field()
on a normal post. get_field_from_block( 'my_acf_author_name', 2, 'block-1234567890' )
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.