Skip to content

Commit ade033a

Browse files
authored
Merge pull request #7 from FeXd/fix-date
Fix Bug with Date Picker
2 parents d3bb5ca + dd50ca2 commit ade033a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

quick-weblog.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Quick Weblog
55
Plugin URI: https://github.com/FeXd/wordpress-plugin-quick-weblog
66
Description: Quickly create a simple Post that highlights an existing news article.
7-
Version: 0.0.2
7+
Version: 0.0.3
88
Author: Arlin Schaffel
99
Author URI: https://github.com/FeXd
1010
License: MIT
@@ -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)