Making WordPress.org


Ignore:
Timestamp:
07/06/2021 08:33:03 PM (3 years ago)
Author:
ryelle
Message:

Plugin Directory: Remove "style" requirement when validating block plugins.

Previously, either editorStyle or style was required for block plugins, but this was not communicated to the plugin developer (only as a recommendation). This caused some block plugins to pass the validation in UI, but still fail validation behind the scenes. Omitting a style doesn't break anything on the core side, so it should be allowed.

Props oskosk for flagging an affected block.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/block-json/class-validator.php

    r10916 r11096  
    234234            $this->append_error_data( 'block.json:script', 'error' );
    235235            $this->append_error_data( 'block.json:editorScript', 'error' );
    236         }
    237 
    238         if ( ! isset( $block_json->style ) && ! isset( $block_json->editorStyle ) ) {
    239             $this->messages->add(
    240                 'error',
    241                 sprintf(
    242                     __( 'At least one of the following properties must be present: %s', 'wporg-plugins' ),
    243                     // translators: used between list items, there is a space after the comma.
    244                     '<code>style</code>' . __( ', ', 'wporg-plugins' ) . '<code>editorStyle</code>'
    245                 )
    246             );
    247             $this->append_error_data( 'block.json:style', 'error' );
    248             $this->append_error_data( 'block.json:editorStyle', 'error' );
    249236        }
    250237    }
Note: See TracChangeset for help on using the changeset viewer.