Changeset 44360
- Timestamp:
- 12/24/2018 01:44:05 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gruntfile.js
r44359 r44360 26 26 'wp-content/plugins/hello.php', 27 27 'wp-content/plugins/akismet/**' 28 ]; 28 ], 29 changedFiles = { 30 php: [] 31 }; 29 32 30 33 if ( 'watch:phpunit' === grunt.cli.tasks[ 0 ] && ! phpUnitWatchGroup ) { -
trunk/src/index.php
r44359 r44360 37 37 ) . '</p>'; 38 38 39 $die .= '<p>' . __( 'Before running any grunt tasks you need to make sure the dependencies are installed. You can install these by running ' );39 $die .= '<p>' . __( 'Before running any grunt tasks you need to make sure the dependencies are installed. You can install these by running ' ); 40 40 $die .= '<code style="color: green;">npm install</code>.</p>'; 41 41 … … 44 44 /* translators: %s: WordPress */ 45 45 __( 'To build %s while developing run:' ), 46 47 46 'WordPress' 47 ) . '<br /><br />'; 48 48 $die .= '<code style="color: green;">grunt build --dev</code></li>'; 49 49 $die .= '<li>' . sprintf( 50 51 52 50 __( 'To build files automatically when changing the source files run:' ), 51 'WordPress' 52 ) . '<br /><br />'; 53 53 $die .= '<code style="color: green;">grunt watch</code></li>'; 54 54 $die .= '<li>' . sprintf( 55 56 57 55 __( 'To create a production build of %s run:' ), 56 'WordPress' 57 ) . '<br /><br />'; 58 58 $die .= '<code style="color: green;">grunt build</code></li>'; 59 59 $die .= '</ul>'; -
trunk/src/wp-admin/index.php
r44359 r44360 37 37 ) . '</p>'; 38 38 39 $die .= '<p>' . __( 'Before running any grunt tasks you need to make sure the dependencies are installed. You can install these by running ' );39 $die .= '<p>' . __( 'Before running any grunt tasks you need to make sure the dependencies are installed. You can install these by running ' ); 40 40 $die .= '<code style="color: green;">npm install</code>.</p>'; 41 41 … … 44 44 /* translators: %s: WordPress */ 45 45 __( 'To build %s while developing run:' ), 46 47 46 'WordPress' 47 ) . '<br /><br />'; 48 48 $die .= '<code style="color: green;">grunt build --dev</code></li>'; 49 49 $die .= '<li>' . sprintf( 50 51 52 50 __( 'To build files automatically when changing the source files run:' ), 51 'WordPress' 52 ) . '<br /><br />'; 53 53 $die .= '<code style="color: green;">grunt watch</code></li>'; 54 54 $die .= '<li>' . sprintf( 55 56 57 55 __( 'To create a production build of %s run:' ), 56 'WordPress' 57 ) . '<br /><br />'; 58 58 $die .= '<code style="color: green;">grunt build</code></li>'; 59 59 $die .= '</ul>'; … … 63 63 /* translators: %1$s: NPM URL, %2$s: Grunt URL */ 64 64 __( 'This requires <a href="%1$s">NPM</a> and <a href="%2$s">Grunt</a>. <a href="%3$s">Read more about setting up your local development environment</a>.' ), 65 66 67 68 65 'https://www.npmjs.com/', 66 'https://gruntjs.com/', 67 __( 'https://make.wordpress.org/core/handbook/tutorials/installing-wordpress-locally/' ) 68 ) . '</p>'; 69 69 70 70 wp_die( $die, __( 'WordPress › Error' ) ); -
trunk/src/wp-includes/class-wp-block-parser.php
r44359 r44360 64 64 65 65 function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) { 66 $this->blockName = $name;67 $this->attrs = $attrs;68 $this->innerBlocks = $innerBlocks;69 $this->innerHTML = $innerHTML;66 $this->blockName = $name; 67 $this->attrs = $attrs; 68 $this->innerBlocks = $innerBlocks; 69 $this->innerHTML = $innerHTML; 70 70 $this->innerContent = $innerContent; 71 71 } … … 270 270 if ( 0 === $stack_depth ) { 271 271 if ( isset( $leading_html_start ) ) { 272 $this->output[] = (array) self::freeform( substr( 273 $this->document, 274 $leading_html_start, 275 $start_offset - $leading_html_start 276 ) ); 272 $this->output[] = (array) self::freeform( 273 substr( 274 $this->document, 275 $leading_html_start, 276 $start_offset - $leading_html_start 277 ) 278 ); 277 279 } 278 280 279 281 $this->output[] = (array) new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ); 280 $this->offset = $start_offset + $token_length;282 $this->offset = $start_offset + $token_length; 281 283 return true; 282 284 } … … 293 295 case 'block-opener': 294 296 // track all newly-opened blocks on the stack 295 array_push( $this->stack, new WP_Block_Parser_Frame( 296 new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), 297 $start_offset, 298 $token_length, 299 $start_offset + $token_length, 300 $leading_html_start 301 ) ); 297 array_push( 298 $this->stack, 299 new WP_Block_Parser_Frame( 300 new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), 301 $start_offset, 302 $token_length, 303 $start_offset + $token_length, 304 $leading_html_start 305 ) 306 ); 302 307 $this->offset = $start_offset + $token_length; 303 308 return true; … … 330 335 * block and add it as a new innerBlock to the parent 331 336 */ 332 $stack_top = array_pop( $this->stack );333 $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset );334 $stack_top->block->innerHTML .= $html;337 $stack_top = array_pop( $this->stack ); 338 $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); 339 $stack_top->block->innerHTML .= $html; 335 340 $stack_top->block->innerContent[] = $html; 336 $stack_top->prev_offset = $start_offset + $token_length;341 $stack_top->prev_offset = $start_offset + $token_length; 337 342 338 343 $this->add_inner_block( … … 392 397 } 393 398 394 list( $match, $started_at ) = $matches[ 0];399 list( $match, $started_at ) = $matches[0]; 395 400 396 401 $length = strlen( $match ); 397 $is_closer = isset( $matches[ 'closer' ] ) && -1 !== $matches[ 'closer' ][ 1];398 $is_void = isset( $matches[ 'void' ] ) && -1 !== $matches[ 'void' ][ 1];399 $namespace = $matches[ 'namespace'];400 $namespace = ( isset( $namespace ) && -1 !== $namespace[ 1 ] ) ? $namespace[ 0] : 'core/';401 $name = $namespace . $matches[ 'name' ][ 0];402 $has_attrs = isset( $matches[ 'attrs' ] ) && -1 !== $matches[ 'attrs' ][ 1];402 $is_closer = isset( $matches['closer'] ) && -1 !== $matches['closer'][1]; 403 $is_void = isset( $matches['void'] ) && -1 !== $matches['void'][1]; 404 $namespace = $matches['namespace']; 405 $namespace = ( isset( $namespace ) && -1 !== $namespace[1] ) ? $namespace[0] : 'core/'; 406 $name = $namespace . $matches['name'][0]; 407 $has_attrs = isset( $matches['attrs'] ) && -1 !== $matches['attrs'][1]; 403 408 404 409 /* … … 407 412 */ 408 413 $attrs = $has_attrs 409 ? json_decode( $matches[ 'attrs' ][ 0], /* as-associative */ true )414 ? json_decode( $matches['attrs'][0], /* as-associative */ true ) 410 415 : $this->empty_attrs; 411 416 … … 472 477 */ 473 478 function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) { 474 $parent = $this->stack[ count( $this->stack ) - 1 ];479 $parent = $this->stack[ count( $this->stack ) - 1 ]; 475 480 $parent->block->innerBlocks[] = (array) $block; 476 $html = substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset );481 $html = substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ); 477 482 478 483 if ( ! empty( $html ) ) { 479 $parent->block->innerHTML .= $html;484 $parent->block->innerHTML .= $html; 480 485 $parent->block->innerContent[] = $html; 481 486 } 482 487 483 488 $parent->block->innerContent[] = null; 484 $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length;489 $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; 485 490 } 486 491 … … 501 506 502 507 if ( ! empty( $html ) ) { 503 $stack_top->block->innerHTML .= $html;508 $stack_top->block->innerHTML .= $html; 504 509 $stack_top->block->innerContent[] = $html; 505 510 } 506 511 507 512 if ( isset( $stack_top->leading_html_start ) ) { 508 $this->output[] = (array) self::freeform( substr( 509 $this->document, 510 $stack_top->leading_html_start, 511 $stack_top->token_start - $stack_top->leading_html_start 512 ) ); 513 $this->output[] = (array) self::freeform( 514 substr( 515 $this->document, 516 $stack_top->leading_html_start, 517 $stack_top->token_start - $stack_top->leading_html_start 518 ) 519 ); 513 520 } 514 521
Note: See TracChangeset
for help on using the changeset viewer.