Changeset 44116
- Timestamp:
- 12/13/2018 05:39:59 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43751
- Property svn:mergeinfo changed
-
trunk/src/wp-includes/blocks.php
r44109 r44116 113 113 return $dynamic_block_names; 114 114 } 115 116 /** 117 * Parses blocks out of a content string. 118 * 119 * @since 5.0.0 120 * 121 * @param string $content Post content. 122 * @return array Array of parsed block objects. 123 */ 124 function parse_blocks( $content ) { 125 /* 126 * If there are no blocks in the content, return a single block, rather 127 * than wasting time trying to parse the string. 128 */ 129 if ( ! has_blocks( $content ) ) { 130 return array( 131 array( 132 'blockName' => null, 133 'attrs' => array(), 134 'innerBlocks' => array(), 135 'innerHTML' => $content, 136 ), 137 ); 138 } 139 140 /** 141 * Filter to allow plugins to replace the server-side block parser 142 * 143 * @since 5.0.0 144 * 145 * @param string $parser_class Name of block parser class 146 */ 147 $parser_class = apply_filters( 'block_parser_class', 'WP_Block_Parser' ); 148 149 $parser = new $parser_class(); 150 return $parser->parse( $content ); 151 } -
trunk/src/wp-settings.php
r44108 r44116 247 247 require( ABSPATH . WPINC . '/class-wp-block-type.php' ); 248 248 require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' ); 249 require( ABSPATH . WPINC . '/class-wp-block-parser.php' ); 249 250 require( ABSPATH . WPINC . '/blocks.php' ); 250 251 -
trunk/tools/webpack/packages.js
r44114 r44116 117 117 }; 118 118 119 const phpFiles = { 120 'block-serialization-default-parser/parser.php': 'wp-includes/class-wp-block-parser.php', 121 }; 122 119 123 const externals = { 120 124 react: 'React', … … 165 169 } ) ); 166 170 171 const phpCopies = Object.keys( phpFiles ).map( ( filename ) => ( { 172 from: join( baseDir, `node_modules/@wordpress/${ filename }` ), 173 to: join( baseDir, `src/${ phpFiles[ filename ] }` ), 174 } ) ); 175 167 176 const config = { 168 177 mode, … … 233 242 ...vendorCopies, 234 243 ...cssCopies, 244 ...phpCopies, 235 245 ], 236 246 ),
Note: See TracChangeset
for help on using the changeset viewer.