Skip to content

Commit 6a242ae

Browse files
authored
Fix importing posts (#809)
1 parent 4089f27 commit 6a242ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

functions/events.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ function sunflower_add_event_meta_boxes() {
106106
function sunflower_save_event_meta_boxes() {
107107
global $post;
108108

109+
if ( ! isset( $post->ID ) || empty( $_POST ) ) {
110+
return;
111+
}
112+
109113
// Do not save, if nonce is invalid.
110114
if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'update-post_' . $post->ID ) ) {
111115
return;
@@ -118,10 +122,6 @@ function sunflower_save_event_meta_boxes() {
118122

119123
$sunflower_event_fields = sunflower_get_event_fields();
120124

121-
if ( ! isset( $post->ID ) ) {
122-
return;
123-
}
124-
125125
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
126126
return;
127127
}

0 commit comments

Comments
 (0)