Changeset 55246 for trunk/src/wp-includes/class-wp-block-parser.php
- Timestamp:
- 02/07/2023 07:01:56 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-block-parser.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block-parser.php
r54257 r55246 81 81 * @param array $innerContent List of string fragments and null markers where inner blocks were found. 82 82 */ 83 function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) {83 public function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) { 84 84 $this->blockName = $name; 85 85 $this->attrs = $attrs; … … 153 153 * @param int $leading_html_start Byte offset into document where leading HTML before token starts. 154 154 */ 155 function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) {155 public function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) { 156 156 $this->block = $block; 157 157 $this->token_start = $token_start; … … 225 225 * @return array[] 226 226 */ 227 function parse( $document ) {227 public function parse( $document ) { 228 228 $this->document = $document; 229 229 $this->offset = 0; … … 232 232 $this->empty_attrs = json_decode( '{}', true ); 233 233 234 do{235 // twiddle our thumbs.236 } while ( $this->proceed() );234 while ( $this->proceed() ) { 235 continue; 236 } 237 237 238 238 return $this->output; … … 253 253 * @return bool 254 254 */ 255 function proceed() {255 public function proceed() { 256 256 $next_token = $this->next_token(); 257 257 list( $token_type, $block_name, $attrs, $start_offset, $token_length ) = $next_token; … … 399 399 * @return array 400 400 */ 401 function next_token() {401 public function next_token() { 402 402 $matches = null; 403 403 … … 474 474 * @return WP_Block_Parser_Block freeform block object. 475 475 */ 476 function freeform( $innerHTML ) {476 public function freeform( $innerHTML ) { 477 477 return new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $innerHTML, array( $innerHTML ) ); 478 478 } … … 486 486 * @param null $length how many bytes of document text to output. 487 487 */ 488 function add_freeform( $length = null ) {488 public function add_freeform( $length = null ) { 489 489 $length = $length ? $length : strlen( $this->document ) - $this->offset; 490 490 … … 507 507 * @param int|null $last_offset Last byte offset into document if continuing form earlier output. 508 508 */ 509 function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) {509 public function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) { 510 510 $parent = $this->stack[ count( $this->stack ) - 1 ]; 511 511 $parent->block->innerBlocks[] = (array) $block; … … 528 528 * @param int|null $end_offset byte offset into document for where we should stop sending text output as HTML. 529 529 */ 530 function add_block_from_stack( $end_offset = null ) {530 public function add_block_from_stack( $end_offset = null ) { 531 531 $stack_top = array_pop( $this->stack ); 532 532 $prev_offset = $stack_top->prev_offset;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)