Skip to content

Commit 5c3253f

Browse files
committed
Fix Bug with Date Picker
- I was not actually using the data selected when I submitted posts, whoops!
1 parent d3bb5ca commit 5c3253f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

quick-weblog.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ function quick_weblog_submit_form()
176176
$url = esc_url_raw($_POST['url']);
177177
$category = intval($_POST['category']);
178178
$tags = sanitize_text_field($_POST['tags']);
179+
$post_date = sanitize_text_field($_POST['post_date']);
179180

180181
// Create block content
181182
$image_block = '<!-- wp:image {"url":"' . esc_attr($image_url) . '","alt":"' . esc_attr($image_description) . '"} -->' .
@@ -198,7 +199,8 @@ function quick_weblog_submit_form()
198199
'post_content' => $block_content,
199200
'post_category' => array($category),
200201
'tags_input' => $tags,
201-
'post_status' => 'publish'
202+
'post_status' => 'publish',
203+
'post_date' => $post_date
202204
);
203205
$post_id = wp_insert_post($post_data);
204206

0 commit comments

Comments
 (0)