Title: Problems unsing multiple empty image blocks
Last modified: May 15, 2022

---

# Problems unsing multiple empty image blocks

 *  Resolved [adrianfilipow](https://wordpress.org/support/users/adrianfilipow/)
 * (@adrianfilipow)
 * [4 years ago](https://wordpress.org/support/topic/problems-unsing-multiple-empty-image-blocks/)
 * Hello,
 * I am working on a plugin that selects a specific attachment in a media frame.
   I encountered some problems using multiple empty blocks in one post.
 * If I am on a post and I create a block e.g. „image“ and choose „Media Library“
   to pick an attachment the media frame opens.
 * Then I select an attachment using: „wp.media.frame.state().get(‘selection’).add(
   wp.media.attachment(5))“ and everything works as expected.
 * The problem: If I place multiple empty blocks and choose „Media Library“ from
   a block that is above another empty block I get an error that the state is undefined.
 * Why is that happening and how could I fix this?
 * A short screen capture for better understanding: [https://streamable.com/c4xuw5](https://streamable.com/c4xuw5)
    -  This topic was modified 4 years ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
      Reason: fixing -> developing

Viewing 1 replies (of 1 total)

 *  Thread Starter [adrianfilipow](https://wordpress.org/support/users/adrianfilipow/)
 * (@adrianfilipow)
 * [4 years ago](https://wordpress.org/support/topic/problems-unsing-multiple-empty-image-blocks/#post-15659586)
 * moved to another forum

Viewing 1 replies (of 1 total)

The topic ‘Problems unsing multiple empty image blocks’ is closed to new replies.

## Tags

 * [media library](https://wordpress.org/support/topic-tag/media-library/)
 * [selection](https://wordpress.org/support/topic-tag/selection/)
 * [state](https://wordpress.org/support/topic-tag/state/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 1 participant
 * Last reply from: [adrianfilipow](https://wordpress.org/support/users/adrianfilipow/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/problems-unsing-multiple-empty-image-blocks/#post-15659586)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
