PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
← All changes | shortcodes/shortcode-wdk-listing-field-value.php +7 -29 trunk → 1.5.9 View file →
@@ -46,42 +46,20 @@
46 46 $data['field_prefix'] = '';
47 47 $data['field_suffix'] = '';
48 48
49 49 /* protect check */
50 + if(in_array($data['settings']['field_id'], ['post_password', 'status']) ) {
51 + return false;
52 + }
50 53
51 - /* Allow only public built-in fields. */
52 - $allowed_fields = array(
53 - 'post_title', 'category_id', 'location_id', 'post_content'
54 - );
55 -
56 - $field_id = (string) $data['settings']['field_id'];
57 - if (
58 - !is_numeric($field_id) &&
59 - !in_array($field_id, $allowed_fields, true)
60 - ) {
61 - return '';
62 - }
63 -
64 54 $post_data = get_post($post_id);
65 - if (
66 - !$post_data ||
67 - $post_data->post_type !== 'wdk-listing' ||
68 - $post_data->post_status !== 'publish' ||
69 - post_password_required($post_data)
70 - ) {
71 - return '';
55 + if (!$post_data || $post_data->post_status != 'publish' || post_password_required($post_data)) {
56 + return false;
72 57 }
73 58
74 - if ( is_numeric($data['settings']['field_id']) && wdk_field_option($data['settings']['field_id'], 'is_visible_frontend') != 1 ) {
75 - return '';
59 + if(wdk_field_option($data['settings']['field_id'], 'is_visible_frontend') != 1) {
60 + return false;
76 61 }
77 -
78 - if (
79 - !wdk_field_value('is_activated', $post_id, false) || !wdk_field_value('is_approved', $post_id,false)
80 - ) {
81 - return __( 'Listing is not public', 'wpdirectorykit' );
82 - }
83 -
84 62
85 63 if(!empty($data['settings']['field_id'])){
86 64 if(strpos($data['settings']['field_id'],'__') !== FALSE){
87 65 $data['settings']['field_id'] = substr($data['settings']['field_id'], strpos($data['settings']['field_id'],'__')+2);