Changeset 43751
- Timestamp:
- 10/18/2018 04:39:40 AM (6 years ago)
- Location:
- branches/5.0
- Files:
-
- 215 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/blocks.php
r43743 r43751 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 } -
branches/5.0/src/wp-settings.php
r43742 r43751 246 246 require( ABSPATH . WPINC . '/class-wp-block-type.php' ); 247 247 require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' ); 248 require( ABSPATH . WPINC . '/class-wp-block-parser.php' ); 248 249 require( ABSPATH . WPINC . '/blocks.php' ); 249 250 -
branches/5.0/tools/webpack/packages.js
r43723 r43751 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.