Remove left alignment option in core/image block


I’m trying this code to disable the left alignment option from the core/image block. I just want to make available the center and right alignment options.

  function( settings, name ) {
    if ( name === 'core/image' ) {
      // Change supports
      settings.supports = lodash.merge( {}, settings.supports, {
        align: [‘center’,’right’]

return settings;

However, instead of doing what I’m expecting, it is adding a new alignment selector option to the block with only the center and right options, keeping the other default one with all of them (left, center, right).

enter image description here

Is blocks.registerBlockType the right filter to do it, or I’m missing something else?

, , elvismdev 3 years 2020-04-08T04:50:55-05:00 0 Answers 129 views 0

Leave an answer