File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 4
4
Plugin Name: Quick Weblog
5
5
Plugin URI: https://github.com/FeXd/wordpress-plugin-quick-weblog
6
6
Description: Quickly create a simple Post that highlights an existing news article.
7
- Version: 0.0.2
7
+ Version: 0.0.3
8
8
Author: Arlin Schaffel
9
9
Author URI: https://github.com/FeXd
10
10
License: MIT
@@ -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