Skip to content

Commit

Permalink
Merge pull request #7 from FeXd/fix-date
Browse files Browse the repository at this point in the history
Fix Bug with Date Picker
  • Loading branch information
FeXd authored Apr 6, 2023
2 parents d3bb5ca + dd50ca2 commit ade033a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions quick-weblog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: Quick Weblog
Plugin URI: https://github.com/FeXd/wordpress-plugin-quick-weblog
Description: Quickly create a simple Post that highlights an existing news article.
Version: 0.0.2
Version: 0.0.3
Author: Arlin Schaffel
Author URI: https://github.com/FeXd
License: MIT
Expand Down Expand Up @@ -176,6 +176,7 @@ function quick_weblog_submit_form()
$url = esc_url_raw($_POST['url']);
$category = intval($_POST['category']);
$tags = sanitize_text_field($_POST['tags']);
$post_date = sanitize_text_field($_POST['post_date']);

// Create block content
$image_block = '<!-- wp:image {"url":"' . esc_attr($image_url) . '","alt":"' . esc_attr($image_description) . '"} -->' .
Expand All @@ -198,7 +199,8 @@ function quick_weblog_submit_form()
'post_content' => $block_content,
'post_category' => array($category),
'tags_input' => $tags,
'post_status' => 'publish'
'post_status' => 'publish',
'post_date' => $post_date
);
$post_id = wp_insert_post($post_data);

Expand Down

0 comments on commit ade033a

Please sign in to comment.