| @@ -114,8 +114,13 @@ | ||
| 114 | 114 | 'field' => 'related_svg_map_location', |
| 115 | 115 | 'label' => __('Related SVG Map Location', 'wpdirectorykit'), |
| 116 | 116 | 'rules' => '' |
| 117 | 117 | ), |
| 118 | + array( | |
| 119 | + 'field' => 'titles_for_search', | |
| 120 | + 'label' => __('Alternative titles for search', 'wpdirectorykit'), | |
| 121 | + 'rules' => '' | |
| 122 | + ), | |
| 118 | 123 | ); |
| 119 | 124 | |
| 120 | 125 | global $wp_filesystem; |
| 121 | 126 | // Initialize the WP filesystem, no more using 'file-put-contents' function |
| @@ -134,9 +139,11 @@ | ||
| 134 | 139 | |
| 135 | 140 | /* translate */ |
| 136 | 141 | $this->data['maps_list'] = array(); |
| 137 | 142 | foreach ($maps_list as $location_key => $location) { |
| 138 | - $this->data['maps_list'][str_replace('.svg', '', $location_key)] = esc_html__($location, 'wdk-svg-map'); | |
| 143 | + // Dynamic field values are registered in the translation catalog separately. | |
| 144 | +// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 145 | + $this->data['maps_list'][str_replace('.svg', '', $location_key)] = esc_html__($location, 'wpdirectorykit'); | |
| 139 | 146 | } |
| 140 | 147 | } |
| 141 | 148 | |
| 142 | 149 | $this->data['map_related_locations'] = array(); |
| @@ -148,9 +155,11 @@ | ||
| 148 | 155 | |
| 149 | 156 | if(function_exists('run_wdk_svg_map')) { |
| 150 | 157 | if(wmvc_show_data('related_svg_map', $this->data['db_data'], false) && isset($maps_data[wmvc_show_data('related_svg_map', $this->data['db_data'])])) { |
| 151 | 158 | foreach ($maps_data[wmvc_show_data('related_svg_map', $this->data['db_data'])]['locations'] as $location_key => $location) { |
| 152 | - $this->data['map_related_locations'][$location_key] = esc_html__($location, 'wdk-svg-map'); | |
| 159 | + // Dynamic field values are registered in the translation catalog separately. | |
| 160 | +// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 161 | + $this->data['map_related_locations'][$location_key] = esc_html__($location, 'wpdirectorykit'); | |
| 153 | 162 | } |
| 154 | 163 | |
| 155 | 164 | asort($this->data['map_related_locations']); |
| 156 | 165 | } |
| @@ -215,9 +224,9 @@ | ||
| 215 | 224 | public function import_from_svg() |
| 216 | 225 | { |
| 217 | 226 | |
| 218 | 227 | if(!function_exists('run_wdk_svg_map')) { |
| 219 | - exit(esc_html__('Addon WDK SVG Map missing', 'wdk-svg-map')); | |
| 228 | + exit(esc_html__('Addon WDK SVG Map missing', 'wpdirectorykit')); | |
| 220 | 229 | } |
| 221 | 230 | |
| 222 | 231 | $this->load->model('location_m'); |
| 223 | 232 | |
| @@ -237,9 +246,11 @@ | ||
| 237 | 246 | |
| 238 | 247 | /* translate */ |
| 239 | 248 | $this->data['maps_list'] = array(); |
| 240 | 249 | foreach ($maps_data as $location_key => $location) { |
| 241 | - $this->data['maps_list'][str_replace('.svg', '', $location_key)] = esc_html__($location, 'wdk-svg-map'); | |
| 250 | + // Dynamic field values are registered in the translation catalog separately. | |
| 251 | +// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 252 | + $this->data['maps_list'][str_replace('.svg', '', $location_key)] = esc_html__($location, 'wpdirectorykit'); | |
| 242 | 253 | } |
| 243 | 254 | |
| 244 | 255 | $this->data['db_data'] = NULL; |
| 245 | 256 | |
| @@ -277,10 +288,14 @@ | ||
| 277 | 288 | |
| 278 | 289 | if(isset($maps_data[strtolower(wmvc_show_data('related_svg_map',$data))])) { |
| 279 | 290 | $insert_data = array('parent_id' => wmvc_show_data('related_svg_map_location',$data, NULL)); |
| 280 | 291 | foreach ($maps_data[strtolower(wmvc_show_data('related_svg_map',$data))]['locations'] as $location_key => $location) { |
| 281 | - if(!$this->location_m->get_by(array('parent_id'=>wmvc_show_data('related_svg_map_location',$data, NULL),'location_title'=>esc_html__($location, 'wdk-svg-map')), TRUE)) | |
| 282 | - $insert_id = $this->location_m->insert(array_merge($insert_data, array('location_title' => esc_html__($location, 'wdk-svg-map'))), NULL); | |
| 292 | + // Dynamic field values are registered in the translation catalog separately. | |
| 293 | +// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 294 | +if(!$this->location_m->get_by(array('parent_id'=>wmvc_show_data('related_svg_map_location',$data, NULL),'location_title'=>esc_html__($location, 'wpdirectorykit')), TRUE)) | |
| 295 | + // Dynamic field values are registered in the translation catalog separately. | |
| 296 | +// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 297 | + $insert_id = $this->location_m->insert(array_merge($insert_data, array('location_title' => esc_html__($location, 'wpdirectorykit'))), NULL); | |
| 283 | 298 | } |
| 284 | 299 | } |
| 285 | 300 | |
| 286 | 301 | } |