Skip to content

Commit 235385c

Browse files
committed
Revert "Block Creation Example"
This reverts commit 2c11541.
1 parent 590e162 commit 235385c

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

quick-weblog.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -148,29 +148,6 @@ function quick_weblog_submit_form() {
148148
'tags_input' => $tags,
149149
'post_status' => 'publish'
150150
);
151-
152-
/*
153-
* Create a block programmatically and serialize it.
154-
* https://developer.wordpress.org/reference/functions/serialize_block/
155-
*/
156-
$block_name = 'core/paragraph';
157-
$innerHTML = 'Sample paragraph text.';
158-
159-
$converted_block = new WP_Block_Parser_Block( $block_name, array(), array(), $innerHTML, array( $innerHTML ) );
160-
// WP_CLI::log( print_r( $converted_block, true ) );
161-
162-
$serialized_block = serialize_block( (array) $converted_block );
163-
// WP_CLI::log( $serialized_block );
164-
165-
// Create a new post
166-
$post_data = array(
167-
'post_title' => $title,
168-
'post_content' => $serialized_block,
169-
'post_category' => array( $category ),
170-
'tags_input' => $tags,
171-
'post_status' => 'publish'
172-
);
173-
174151
$post_id = wp_insert_post( $post_data );
175152

176153
// Redirect to the new post

0 commit comments

Comments
 (0)