I have registered a custom block with ACFs acf_register_block
. I have set a render_callback
to load a php template but would like to access any extra CSS classes which the user may have set in the admin.

Does WordPress provide a global like $block
(similar to $post
) or would I need to raise a question on the ACF support forums?
Note that I don’t have ACF PRO 5.8 which comes with the Block features, but I hope this answer helps.
If you look at the example here, you can retrieve the additional/custom CSS classes using props.attributes.className
; i.e. the classes are saved as an attribute named className
.
So with that in mind and based on acf_register_block()
(which as of writing, it redirects to acf_register_block_type()
), your render_callback
function would receive a $block
array (the block settings and attributes) as the first argument, and therefore you should be able to retrieve the additional CSS class(es) via $block['className']
as shown here — see the example under “Registering a block with callback“.