Making WordPress.org

Changeset 13716


Ignore:
Timestamp:
05/16/2024 06:16:54 AM (10 months ago)
Author:
dd32
Message:

Plugin Directory: Blocks: When importing block calls from a javascript file:

  • Allow the title to be wrapped with a class method, such as wp.__( 'title'
  • Don't require title to be the first parameter (just within the first 500char).

See #5207.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r13714 r13716  
    10111011            // Note that this only works with literal strings for the block name and title, and assumes that order.
    10121012            $contents = file_get_contents( $filename );
    1013             if ( $contents && preg_match_all( "#registerBlockType[^{}]{0,500}[(]\s*[\"']([-\w]+/[-\w]+)[\"']\s*,\s*[{]\s*title\s*:[\s\w(]*[\"']([^\"']*)[\"'](?!\s*[+])#ms", $contents, $matches, PREG_SET_ORDER ) ) {
     1013            if ( $contents && preg_match_all( "#registerBlockType[^{}]{0,500}[(]\s*[\"']([-\w]+/[-\w]+)[\"']\s*,\s*[{][^;]{0,500}\s*title\s*:[\s\w(.]*[\"']([^\"']*)[\"'](?!\s*[+])#ms", $contents, $matches, PREG_SET_ORDER ) ) {
    10141014                foreach ( $matches as $match ) {
    10151015                    $blocks[] = (object) [
Note: See TracChangeset for help on using the changeset viewer.