| @@ -51,9 +51,9 @@ | ||
| 51 | 51 | |
| 52 | 52 | global $wdk_listing_id; |
| 53 | 53 | $post_id = $wdk_listing_id; |
| 54 | 54 | if (!empty($data['settings']['post_id'])) { |
| 55 | - $post_id = $data['settings']['post_id']; | |
| 55 | + $post_id = (int)$data['settings']['post_id']; | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $data['post_id'] = $post_id; |
| 59 | 59 | |
| @@ -66,8 +66,14 @@ | ||
| 66 | 66 | if(isset($data['sections_data'][$data['settings']['section_id']])) |
| 67 | 67 | $data['section_data'] = $data['sections_data'][$data['settings']['section_id']]; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | + | |
| 71 | + $post_data = get_post($post_id); | |
| 72 | + if (!$post_data || $post_data->post_status != 'publish' || post_password_required($post_data)) { | |
| 73 | + return false; | |
| 74 | + } | |
| 75 | + | |
| 70 | 76 | if(!empty($data['settings']['field_id'])) |
| 71 | 77 | $data['field_label'] = wdk_field_label($data['settings']['field_id']); |
| 72 | 78 | |
| 73 | 79 | if(empty($data['section_data'])){ |