| @@ -1209,18 +1209,18 @@ | ||
| 1209 | 1209 | |
| 1210 | 1210 | // order |
| 1211 | 1211 | if (isset($_GET_clone['order_by'])) { |
| 1212 | 1212 | // Merge available fields + system columns |
| 1213 | - $order_columns = [ | |
| 1214 | - 'post_id' => $WMVC->db->prefix . 'wdk_listings.post_id', | |
| 1215 | - 'counter_views' => $WMVC->db->prefix . 'wdk_listings.counter_views', | |
| 1216 | - 'date_modified' => $WMVC->db->prefix . 'wdk_listings.date_modified', | |
| 1217 | - 'post_title' => $WMVC->db->prefix . 'posts.post_title', | |
| 1218 | - 'address' => $WMVC->db->prefix . 'wdk_listings.address', | |
| 1219 | - 'category_id' => $WMVC->db->prefix . 'wdk_listings.category_id', | |
| 1220 | - 'location_id' => $WMVC->db->prefix . 'wdk_listings.location_id', | |
| 1221 | - 'rank' => $WMVC->db->prefix . 'wdk_listings.rank' | |
| 1222 | - ]; | |
| 1213 | + $order_columns = array_fill_keys([ | |
| 1214 | + 'post_id', | |
| 1215 | + 'counter_views', | |
| 1216 | + 'date_modified', | |
| 1217 | + 'post_title', | |
| 1218 | + 'address', | |
| 1219 | + 'category_id', | |
| 1220 | + 'location_id', | |
| 1221 | + 'rank' | |
| 1222 | + ], true); | |
| 1223 | 1223 | |
| 1224 | 1224 | $order_columns = apply_filters('wdk/listings/order_columns', $order_columns); |
| 1225 | 1225 | |
| 1226 | 1226 | $_GET_clone['order_by'] = str_replace( |
| @@ -1237,9 +1237,8 @@ | ||
| 1237 | 1237 | |
| 1238 | 1238 | // Parse order_by string into parts |
| 1239 | 1239 | $order_by_array = explode(',', $_GET_clone['order_by']); |
| 1240 | 1240 | $final_order_by = []; |
| 1241 | - | |
| 1242 | 1241 | foreach ($order_by_array as $order_part) { |
| 1243 | 1242 | $order_part = trim($order_part); |
| 1244 | 1243 | |
| 1245 | 1244 | // detect direction asc/desc |
| @@ -1250,9 +1249,9 @@ | ||
| 1250 | 1249 | $direction = 'DESC'; |
| 1251 | 1250 | } |
| 1252 | 1251 | |
| 1253 | 1252 | $order_part = str_ireplace(['desc', 'asc'], '', $order_part); |
| 1254 | - $order_part = esc_sql(sanitize_textarea_field(str_replace(' ', '', $order_part))); | |
| 1253 | + $order_part = str_replace(' ', '', $order_part); | |
| 1255 | 1254 | |
| 1256 | 1255 | // Try to detect field_(id) |
| 1257 | 1256 | if (preg_match('/field_(\d+)\b/', $order_part, $matches)) { |
| 1258 | 1257 | |
| @@ -1276,11 +1275,10 @@ | ||
| 1276 | 1275 | $col_field = end($parts); |
| 1277 | 1276 | } |
| 1278 | 1277 | |
| 1279 | 1278 | // Check if field exists in order_columns |
| 1280 | - if (isset($order_columns[$col_field])) { | |
| 1281 | - $safe_column = $order_columns[$col_field]; | |
| 1282 | - $final_order_by[] = "$safe_column $direction"; | |
| 1279 | + if (isset($order_columns[$col_field]) || isset($available_fields_listings[$col_field])) { | |
| 1280 | + $final_order_by[] = $order_part . ' ' . $direction; | |
| 1283 | 1281 | } |
| 1284 | 1282 | } |
| 1285 | 1283 | } |
| 1286 | 1284 | |
| @@ -2846,9 +2844,9 @@ | ||
| 2846 | 2844 | $custom_js .=" jQuery(function($) { |
| 2847 | 2845 | if( typeof jQuery.fn.wpMediaMultiple == 'function') |
| 2848 | 2846 | $('#".esc_js($field_name)."meta-box-id.postbox-upload-multiple').wpMediaMultiple({ |
| 2849 | 2847 | frame: { |
| 2850 | - title: '".esc_js(__('Upload and select your images here for use with your listing','wpdirectorykit'))."', | |
| 2848 | + title: '".esc_js(__('Select or Upload Media Of Your Chosen Persuasion','wpdirectorykit'))."', | |
| 2851 | 2849 | button: '".esc_js(__('Use this media','wpdirectorykit'))."', |
| 2852 | 2850 | }, |
| 2853 | 2851 | library: { |
| 2854 | 2852 | type: ['application', 'image', 'video'] |
| @@ -3946,18 +3944,8 @@ | ||
| 3946 | 3944 | |
| 3947 | 3945 | // Allow decimal precision to be filtered (default is 0) |
| 3948 | 3946 | $decimals = apply_filters('wdk_number_format_decimals', ((wdk_get_option('wdk_number_format_decimals')) ? wdk_get_option('wdk_number_format_decimals') : 0)); |
| 3949 | 3947 | |
| 3950 | - if(!get_option('wdk_disable_custom_muber_format')) { | |
| 3951 | - global $wp_locale; | |
| 3952 | - return number_format( | |
| 3953 | - $value, | |
| 3954 | - $decimals, | |
| 3955 | - $wp_locale->number_format['decimal_point'], | |
| 3956 | - $wp_locale->number_format['thousands_sep'] | |
| 3957 | - ); | |
| 3958 | - } | |
| 3959 | - | |
| 3960 | 3948 | return number_format_i18n($value, $decimals); |
| 3961 | 3949 | } |
| 3962 | 3950 | } |
| 3963 | 3951 | |