File tree Expand file tree Collapse file tree 1 file changed +1
-35
lines changed Expand file tree Collapse file tree 1 file changed +1
-35
lines changed Original file line number Diff line number Diff line change @@ -21,41 +21,7 @@ final class ContentBlocksResolver {
2121 * @return array<string,mixed>
2222 */
2323 public static function handle_do_block ( array $ block ): array {
24- $ block = self ::cleanup_inner_content ( $ block );
25-
26- return $ block ;
27- }
28-
29- /**
30- * Cleans up inner content of a block.
31- *
32- * This prevents errors when there are more innerContent items than innerBlocks.
33- *
34- * @param array<string,mixed> $block The block to clean up.
35- * @return array<string,mixed> The cleaned up block.
36- */
37- private static function cleanup_inner_content ( array $ block ): array {
38- // If either innerBlocks or innerContent is empty, we don't need to do anything.
39- if ( empty ( $ block ['innerBlocks ' ] ) || empty ( $ block ['innerContent ' ] ) ) {
40- return $ block ;
41- }
42-
43- // If the counts are the same, we don't need to do anything.
44- if ( count ( $ block ['innerBlocks ' ] ) === count ( $ block ['innerContent ' ] ) ) {
45- return $ block ;
46- }
47-
48- // If innerContent has more items than innerBlocks, we need to remove the extra items.
49- if ( count ( $ block ['innerBlocks ' ] ) < count ( $ block ['innerContent ' ] ) ) {
50- graphql_debug (
51- 'cleaning ' ,
52- [
53- 'block ' => $ block ,
54- ]
55- );
56- $ block ['innerContent ' ] = array_filter ( $ block ['innerContent ' ] );
57- }
58-
24+ // @todo.
5925 return $ block ;
6026 }
6127}
You can’t perform that action at this time.
0 commit comments