Title: Update &#8216;Default&#8217; Block Style
Last modified: November 28, 2019

---

# Update ‘Default’ Block Style

 *  [edrescher](https://wordpress.org/support/users/edrescher/)
 * (@edrescher)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/update-default-block-style/)
 * I am trying to programmatically update the default block style of an image block.
 * When a user updates a custom select dropdown in the editor (using ACF plugin),
   I trigger a JS function that unregisters the default core/image style, and registers
   a new one, setting it to the default style.
 * e.g
 *     ```
       wp.blocks.unregisterBlockStyle(
         'core/image',
         [ 'retailResidential', 'weddingsEvents', 'advertisingEditorial']
       );
   
       wp.blocks.registerBlockStyle( 'core/image', {
         name: "weddingsEvents",
         label: "weddingsEvents",
         isDefault: true
       });
       ```
   
 * Then when a user creates a new image block, I want the updated image style class(
   which should be the default), to be automatically applied to the image.
 * However, this is not working, and I am unable to programmatically update the 
   default style in this way. If I manually update the default style using the ‘
   Default Style’ select/dropdown it seems to work for adding additional images,
   but can not do this with JS.
 * Any help is greatly appreciated. Thank you for reading.
    -  This topic was modified 6 years, 7 months ago by [edrescher](https://wordpress.org/support/users/edrescher/).
    -  This topic was modified 6 years, 7 months ago by [edrescher](https://wordpress.org/support/users/edrescher/).

Viewing 1 replies (of 1 total)

 *  [Carike](https://wordpress.org/support/users/carike/)
 * (@carike)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/update-default-block-style/#post-12536987)
 * Please ask Gutenberg related questions here: [https://wordpress.org/support/plugin/gutenberg/](https://wordpress.org/support/plugin/gutenberg/)
   
   They really do want to understand the challenges people are facing when trying
   to extend the editor.

Viewing 1 replies (of 1 total)

The topic ‘Update ‘Default’ Block Style’ is closed to new replies.

## Tags

 * [custom blocks](https://wordpress.org/support/topic-tag/custom-blocks/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [Carike](https://wordpress.org/support/users/carike/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/update-default-block-style/#post-12536987)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
