Sure, you can put almost anything in an array. But I don’t fully understand what you mean.
You want to put the content of a block in an array? Like this?
$my_array = array( get_the_block( 'My block' ) );
Hi Harold.
I have installed the multiple blocks plugin to allow the user to manage the postcodes allowed.
ie:
BT1AAA,BT1BBB,BT1CCC,BT1DDD
So I then want to explode this into an array as such:
$var = array(“BT1AAA”,”BT1BBB”,”BT1CCC”,”BT1DDD”);
Thanks,
Gavin
Okay.. this is kind of a PHP question and unrelated to our plugin, but I can give you some pointers:
$postal_codes = get_the_block( 'Postal codes' ); //Or whatever the name is
$postal_codes = explode( ',', $postal_code ); //Comma separated
You’re a Gentleman. I’ll give that a go.