How to get the attributes of the core/image block via a php function
-
Hi,
I am new to the whole block thing and react js.This is a two part question. Firstly I would like to know how to access all attributes belonging to
the core/image block using php.I have tried this function which I found in the Developers guide but it doesn’t return any of the attributes. The function is defined in functions.php of the child theme and is called in a page template.
function check_attrs() { if ( $block['blockName'] === 'core/image' ) { print_r( $block ); } }
Secondly, please can someone tell me when I add an additional class via the Block Editor like so
Block –> Advanced –> Additional CSS Class(es) –> members, does the members class attribute get added to the core/image block automatically (assuming the block is an image block)?Thank you.
- The topic ‘How to get the attributes of the core/image block via a php function’ is closed to new replies.