File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ function quick_weblog_submit_form()
176
176
$ url = esc_url_raw ($ _POST ['url ' ]);
177
177
$ category = intval ($ _POST ['category ' ]);
178
178
$ tags = sanitize_text_field ($ _POST ['tags ' ]);
179
+ $ post_date = sanitize_text_field ($ _POST ['post_date ' ]);
179
180
180
181
// Create block content
181
182
$ image_block = '<!-- wp:image {"url":" ' . esc_attr ($ image_url ) . '","alt":" ' . esc_attr ($ image_description ) . '"} --> ' .
@@ -198,7 +199,8 @@ function quick_weblog_submit_form()
198
199
'post_content ' => $ block_content ,
199
200
'post_category ' => array ($ category ),
200
201
'tags_input ' => $ tags ,
201
- 'post_status ' => 'publish '
202
+ 'post_status ' => 'publish ' ,
203
+ 'post_date ' => $ post_date
202
204
);
203
205
$ post_id = wp_insert_post ($ post_data );
204
206
You can’t perform that action at this time.
0 commit comments