Changeset 3050498
- Timestamp:
- 03/13/2024 12:43:55 PM (2 years ago)
- Location:
- geoflex
- Files:
-
- 1 added
- 22 edited
- 1 copied
-
assets/screenshot-5.png (modified) (previous)
-
assets/screenshot-6.png (modified) (previous)
-
assets/screenshot-7.png (added)
-
tags/1.2 (copied) (copied from geoflex/trunk)
-
tags/1.2/geoflex.php (modified) (1 diff)
-
tags/1.2/languages/geoflex-ru_RU.mo (modified) (previous)
-
tags/1.2/languages/geoflex-ru_RU.po (modified) (4 diffs)
-
tags/1.2/languages/geoflex.pot (modified) (4 diffs)
-
tags/1.2/readme.txt (modified) (4 diffs)
-
tags/1.2/src/Admin/Metabox.php (modified) (4 diffs)
-
tags/1.2/src/Admin/Support.php (modified) (1 diff)
-
tags/1.2/src/Plugin.php (modified) (1 diff)
-
tags/1.2/src/Region.php (modified) (2 diffs)
-
tags/1.2/src/Utils/Helpers.php (modified) (1 diff)
-
trunk/geoflex.php (modified) (1 diff)
-
trunk/languages/geoflex-ru_RU.mo (modified) (previous)
-
trunk/languages/geoflex-ru_RU.po (modified) (4 diffs)
-
trunk/languages/geoflex.pot (modified) (4 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/src/Admin/Metabox.php (modified) (4 diffs)
-
trunk/src/Admin/Support.php (modified) (1 diff)
-
trunk/src/Plugin.php (modified) (1 diff)
-
trunk/src/Region.php (modified) (2 diffs)
-
trunk/src/Utils/Helpers.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
geoflex/tags/1.2/geoflex.php
r3049631 r3050498 4 4 * Plugin Name: Geoflex 5 5 * Description: Adds multiregional capability to WordPress 6 * Version: 1. 16 * Version: 1.2 7 7 * Requires at least: 5.8.3 8 8 * Requires PHP: 7.4 -
geoflex/tags/1.2/languages/geoflex-ru_RU.po
r3049631 r3050498 2 2 msgstr "" 3 3 "Project-Id-Version: \n" 4 "POT-Creation-Date: 2024-03-1 1 17:09+0300\n"5 "PO-Revision-Date: 2024-03-1 1 17:12+0300\n"4 "POT-Creation-Date: 2024-03-13 15:03+0300\n" 5 "PO-Revision-Date: 2024-03-13 15:04+0300\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 243 243 244 244 #: src/Admin/Support.php:43 245 msgid "" 246 "For correct work of the plugin do not use Permalink structure \"Plain" 247 "\" (Setting->Permalinks)." 248 msgstr "" 249 "Для правильной работы плагина не используйте структуру постоянных ссылок " 250 "\"Простые\" (Настройки->Постоянные ссылки)" 251 252 #: src/Admin/Support.php:44 245 253 msgid "Substitution options:" 246 254 msgstr "Варианты замен:" 247 255 248 #: src/Admin/Support.php:4 5256 #: src/Admin/Support.php:46 249 257 msgid "the name of the region. For example, <strong>«Warsaw»</strong>." 250 258 msgstr "название региона. Например, <strong>«Варшава»</strong>." 251 259 252 #: src/Admin/Support.php:46253 msgid ""254 "when talking about something that is in a region. For example, <strong>«In "255 "Warsaw»</strong>, <strong>«W Warszawie»</strong>."256 msgstr "в регионе. Например, <strong>«В Варшаве»</strong>."257 258 260 #: src/Admin/Support.php:47 261 msgid "" 262 "in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W " 263 "Warszawie»</strong>." 264 msgstr "" 265 "в регионе. Например, <strong>«В Варшеве»</strong>, <strong>«В Варшеве»</" 266 "strong>." 267 268 #: src/Admin/Support.php:48 259 269 msgid "" 260 270 "by region. For example, <strong>«By Warsaw»</strong>, <strong>«W Warszawie»</" … … 262 272 msgstr "по региону. Например, <strong>«По Варшаве»</strong>." 263 273 264 #: src/Admin/Support.php:4 8274 #: src/Admin/Support.php:49 265 275 msgid "" 266 276 "from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z " … … 268 278 msgstr "из региона. Например, <strong>«Из Варшавы»</strong>." 269 279 270 #: src/Admin/Support.php: 49280 #: src/Admin/Support.php:50 271 281 msgid "phone number for the region" 272 282 msgstr "номер телефона для региона" 273 283 274 #: src/Admin/Support.php:5 0284 #: src/Admin/Support.php:51 275 285 msgid "address for the region" 276 286 msgstr "адрес в регионе" 277 287 278 #: src/Admin/Support.php:5 1288 #: src/Admin/Support.php:52 279 289 msgid "email for the region" 280 290 msgstr "email для региона" 281 291 282 #: src/Admin/Support.php:5 2292 #: src/Admin/Support.php:53 283 293 msgid "link for the region" 284 294 msgstr "ссылка для региона" 285 295 286 #: src/Region.php:32 0296 #: src/Region.php:324 287 297 msgid "Select a region" 288 298 msgstr "Выберите регион" 289 299 300 #, fuzzy 301 #~| msgid "" 302 #~| "when talking about something that is in a region. For example, " 303 #~| "<strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>." 304 #~ msgid "" 305 #~ "something that is in a region. For example, <strong>«In Warsaw»</strong>, " 306 #~ "<strong>«W Warszawie»</strong>." 307 #~ msgstr "в регионе. Например, <strong>«В Варшаве»</strong>." 308 290 309 #~ msgid "Regions settings" 291 310 #~ msgstr "Настройки регионов" -
geoflex/tags/1.2/languages/geoflex.pot
r3049631 r3050498 3 3 msgstr "" 4 4 "Project-Id-Version: \n" 5 "POT-Creation-Date: 2024-03-1 1 17:09+0300\n"5 "POT-Creation-Date: 2024-03-13 15:03+0300\n" 6 6 "PO-Revision-Date: 2023-11-03 15:22+0400\n" 7 7 "Last-Translator: \n" … … 240 240 241 241 #: src/Admin/Support.php:43 242 msgid "" 243 "For correct work of the plugin do not use Permalink structure \"Plain" 244 "\" (Setting->Permalinks)." 245 msgstr "" 246 247 #: src/Admin/Support.php:44 242 248 msgid "Substitution options:" 243 249 msgstr "" 244 250 245 #: src/Admin/Support.php:4 5251 #: src/Admin/Support.php:46 246 252 msgid "the name of the region. For example, <strong>«Warsaw»</strong>." 247 253 msgstr "" 248 254 249 #: src/Admin/Support.php:46250 msgid ""251 "when talking about something that is in a region. For example, <strong>«In "252 "Warsaw»</strong>, <strong>«W Warszawie»</strong>."253 msgstr ""254 255 255 #: src/Admin/Support.php:47 256 msgid "" 257 "in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W " 258 "Warszawie»</strong>." 259 msgstr "" 260 261 #: src/Admin/Support.php:48 256 262 msgid "" 257 263 "by region. For example, <strong>«By Warsaw»</strong>, <strong>«W " … … 259 265 msgstr "" 260 266 261 #: src/Admin/Support.php:4 8267 #: src/Admin/Support.php:49 262 268 msgid "" 263 269 "from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z " … … 265 271 msgstr "" 266 272 267 #: src/Admin/Support.php: 49273 #: src/Admin/Support.php:50 268 274 msgid "phone number for the region" 269 275 msgstr "" 270 276 271 #: src/Admin/Support.php:5 0277 #: src/Admin/Support.php:51 272 278 msgid "address for the region" 273 279 msgstr "" 274 280 275 #: src/Admin/Support.php:5 1281 #: src/Admin/Support.php:52 276 282 msgid "email for the region" 277 283 msgstr "" 278 284 279 #: src/Admin/Support.php:5 2285 #: src/Admin/Support.php:53 280 286 msgid "link for the region" 281 287 msgstr "" 282 288 283 #: src/Region.php:32 0289 #: src/Region.php:324 284 290 msgid "Select a region" 285 291 msgstr "" -
geoflex/tags/1.2/readme.txt
r3049631 r3050498 5 5 Tested up to: 6.4.2 6 6 Requires PHP: 7.4 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 26 26 27 27 * `{region_name}` the name of the region. For example, **«Warsaw»**, 28 * `{region_in}` when talking about something that isin a region. For example, **«In Warsaw»**, **«W Warszawie»**,28 * `{region_in}` in a region. For example, **«In Warsaw»**, **«W Warszawie»**, 29 29 * `{region_by}` by region. For example, **«By Warsaw»**, **«W Warszawie»**, 30 30 * `{region_from}` from the region. For example, **«From Warsaw»**, **«Z Warszawy»**, … … 42 42 3. Edit Region 43 43 4. Support 44 5. Options in the content 45 6. Regions pop-up 44 5. Options in the content (admin panel) 45 6. Options in the content (result on the website) 46 7. Regions pop-up 46 47 47 48 == Installation == … … 62 63 == Changelog == 63 64 65 = 1.2 = 66 Updated strings to translate 67 Updated instructions on the Support Page 68 64 69 = 1.1 = 65 Update Support page70 Updated Support page 66 71 67 72 = 1.0 = -
geoflex/tags/1.2/src/Admin/Metabox.php
r3049132 r3050498 145 145 <table class="form-table" role="presentation"> 146 146 <tbody> 147 <?php foreach ($this->fields as $field): ?> 147 <?php 148 foreach ($this->fields as $field): 149 if (empty($field["id"]) || empty($field["type"]) || empty($field["label"])) { 150 continue; 151 } 152 ?> 148 153 <tr> 149 154 <th scope="row"> … … 154 159 </td> 155 160 </tr> 156 <?php endforeach; ?> 161 <?php 162 endforeach; 163 ?> 157 164 </tbody> 158 165 </table> … … 195 202 } 196 203 197 $id = $field["id"];204 $id = Helpers::get_meta_key($field["id"], false); 198 205 $type = $field["type"]; 199 206 $default = isset($field["default"] )? $field["default"] : ""; … … 317 324 foreach ($this->fields as $field) { 318 325 $id = $field["id"]; 326 327 if (empty($id)) { 328 continue; 329 } 330 331 $key = Helpers::get_meta_key($id, false); 319 332 $type = $field["type"]; 320 333 321 334 switch ($type) { 322 335 case "checkbox": 323 $value = !!array_key_exists($ id, $_POST);336 $value = !!array_key_exists($key, $_POST); 324 337 break; 325 338 case "textarea": 326 $value = array_key_exists($ id, $_POST) ? sanitize_textarea_field(wp_unslash($_POST[$id])) : false;339 $value = array_key_exists($key, $_POST) ? sanitize_textarea_field(wp_unslash($_POST[$key])) : false; 327 340 break; 328 341 case "code_css": 329 $value = array_key_exists($ id, $_POST) ? wp_unslash($_POST[$id]) : false;342 $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false; 330 343 break; 331 344 case "code_js": 332 $value = array_key_exists($ id, $_POST) ? wp_unslash($_POST[$id]) : false;345 $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false; 333 346 break; 334 347 case "code_html": 335 $value = array_key_exists($ id, $_POST) ? wp_unslash($_POST[$id]) : false;348 $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false; 336 349 break; 337 350 default: 338 $value = array_key_exists($ id, $_POST) ? sanitize_text_field(wp_unslash($_POST[$id])) : false;351 $value = array_key_exists($key, $_POST) ? sanitize_text_field(wp_unslash($_POST[$key])) : false; 339 352 } 340 353 -
geoflex/tags/1.2/src/Admin/Support.php
r3049631 r3050498 41 41 <h3><?php esc_html_e("General options:", "geoflex"); ?></h3> 42 42 <p><?php echo wp_kses(__('To enable opening the region selection window upon clicking the link, it is necessary to add the <code>rel="region"</code> attribute.', "geoflex"), ['code' => []]); ?></p> 43 <p><?php esc_html_e("For correct work of the plugin do not use Permalink structure \"Plain\" (Setting->Permalinks).", "geoflex"); ?></p> 43 44 <h3><?php esc_html_e("Substitution options:", "geoflex"); ?></h3> 44 45 <ul> 45 46 <li><code>{region_name}</code> <?php echo wp_kses(__("the name of the region. For example, <strong>«Warsaw»</strong>.", "geoflex"), ['strong' => []]); ?></li> 46 <li><code>{region_in}</code> <?php echo wp_kses(__(" when talking about something that isin a region. For example, <strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li>47 <li><code>{region_in}</code> <?php echo wp_kses(__("in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li> 47 48 <li><code>{region_by}</code> <?php echo wp_kses(__("by region. For example, <strong>«By Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li> 48 49 <li><code>{region_from}</code> <?php echo wp_kses(__("from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z Warszawy»</strong>.", "geoflex"), ['strong' => []]); ?></li> -
geoflex/tags/1.2/src/Plugin.php
r3049132 r3050498 96 96 $slug = preg_replace("/\./", "", str_replace($home, "", $domain)); 97 97 98 if ($slug ) {98 if ($slug && function_exists("idn_to_utf8")) { 99 99 $slug = sanitize_title(idn_to_utf8($slug)); 100 100 } -
geoflex/tags/1.2/src/Region.php
r3049132 r3050498 103 103 // Fields replaces 104 104 foreach (Metabox::get_fields() as $field) { 105 if ( $field["type"] === "checkbox") {105 if (empty($field["id"]) || $field["type"] === "checkbox") { 106 106 continue; 107 107 } … … 215 215 public function redirect_canonical($redirect, $requested) 216 216 { 217 $redirect_domain = idn_to_ascii(wp_parse_url($redirect, PHP_URL_HOST));217 $redirect_domain = wp_parse_url($redirect, PHP_URL_HOST); 218 218 $requested_domain = wp_parse_url($requested, PHP_URL_HOST); 219 220 if (function_exists("idn_to_ascii")) { 221 $redirect_domain = idn_to_ascii($redirect_domain ); 222 } 219 223 220 224 if ($redirect_domain === $requested_domain) { -
geoflex/tags/1.2/src/Utils/Helpers.php
r3049132 r3050498 11 11 * 12 12 * @param string $id 13 * @param mixed $underscore 13 14 * @return string 14 15 */ 15 public static function get_meta_key(string $id )16 public static function get_meta_key(string $id, bool $underscore = true) 16 17 { 17 return "_geoflex_" . $id; 18 if (empty($id)) { 19 return false; 20 } 21 22 $prefix = $underscore ? "_" : ""; 23 return $prefix . "geoflex_" . $id; 18 24 } 19 25 -
geoflex/trunk/geoflex.php
r3049631 r3050498 4 4 * Plugin Name: Geoflex 5 5 * Description: Adds multiregional capability to WordPress 6 * Version: 1. 16 * Version: 1.2 7 7 * Requires at least: 5.8.3 8 8 * Requires PHP: 7.4 -
geoflex/trunk/languages/geoflex-ru_RU.po
r3049631 r3050498 2 2 msgstr "" 3 3 "Project-Id-Version: \n" 4 "POT-Creation-Date: 2024-03-1 1 17:09+0300\n"5 "PO-Revision-Date: 2024-03-1 1 17:12+0300\n"4 "POT-Creation-Date: 2024-03-13 15:03+0300\n" 5 "PO-Revision-Date: 2024-03-13 15:04+0300\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 243 243 244 244 #: src/Admin/Support.php:43 245 msgid "" 246 "For correct work of the plugin do not use Permalink structure \"Plain" 247 "\" (Setting->Permalinks)." 248 msgstr "" 249 "Для правильной работы плагина не используйте структуру постоянных ссылок " 250 "\"Простые\" (Настройки->Постоянные ссылки)" 251 252 #: src/Admin/Support.php:44 245 253 msgid "Substitution options:" 246 254 msgstr "Варианты замен:" 247 255 248 #: src/Admin/Support.php:4 5256 #: src/Admin/Support.php:46 249 257 msgid "the name of the region. For example, <strong>«Warsaw»</strong>." 250 258 msgstr "название региона. Например, <strong>«Варшава»</strong>." 251 259 252 #: src/Admin/Support.php:46253 msgid ""254 "when talking about something that is in a region. For example, <strong>«In "255 "Warsaw»</strong>, <strong>«W Warszawie»</strong>."256 msgstr "в регионе. Например, <strong>«В Варшаве»</strong>."257 258 260 #: src/Admin/Support.php:47 261 msgid "" 262 "in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W " 263 "Warszawie»</strong>." 264 msgstr "" 265 "в регионе. Например, <strong>«В Варшеве»</strong>, <strong>«В Варшеве»</" 266 "strong>." 267 268 #: src/Admin/Support.php:48 259 269 msgid "" 260 270 "by region. For example, <strong>«By Warsaw»</strong>, <strong>«W Warszawie»</" … … 262 272 msgstr "по региону. Например, <strong>«По Варшаве»</strong>." 263 273 264 #: src/Admin/Support.php:4 8274 #: src/Admin/Support.php:49 265 275 msgid "" 266 276 "from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z " … … 268 278 msgstr "из региона. Например, <strong>«Из Варшавы»</strong>." 269 279 270 #: src/Admin/Support.php: 49280 #: src/Admin/Support.php:50 271 281 msgid "phone number for the region" 272 282 msgstr "номер телефона для региона" 273 283 274 #: src/Admin/Support.php:5 0284 #: src/Admin/Support.php:51 275 285 msgid "address for the region" 276 286 msgstr "адрес в регионе" 277 287 278 #: src/Admin/Support.php:5 1288 #: src/Admin/Support.php:52 279 289 msgid "email for the region" 280 290 msgstr "email для региона" 281 291 282 #: src/Admin/Support.php:5 2292 #: src/Admin/Support.php:53 283 293 msgid "link for the region" 284 294 msgstr "ссылка для региона" 285 295 286 #: src/Region.php:32 0296 #: src/Region.php:324 287 297 msgid "Select a region" 288 298 msgstr "Выберите регион" 289 299 300 #, fuzzy 301 #~| msgid "" 302 #~| "when talking about something that is in a region. For example, " 303 #~| "<strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>." 304 #~ msgid "" 305 #~ "something that is in a region. For example, <strong>«In Warsaw»</strong>, " 306 #~ "<strong>«W Warszawie»</strong>." 307 #~ msgstr "в регионе. Например, <strong>«В Варшаве»</strong>." 308 290 309 #~ msgid "Regions settings" 291 310 #~ msgstr "Настройки регионов" -
geoflex/trunk/languages/geoflex.pot
r3049631 r3050498 3 3 msgstr "" 4 4 "Project-Id-Version: \n" 5 "POT-Creation-Date: 2024-03-1 1 17:09+0300\n"5 "POT-Creation-Date: 2024-03-13 15:03+0300\n" 6 6 "PO-Revision-Date: 2023-11-03 15:22+0400\n" 7 7 "Last-Translator: \n" … … 240 240 241 241 #: src/Admin/Support.php:43 242 msgid "" 243 "For correct work of the plugin do not use Permalink structure \"Plain" 244 "\" (Setting->Permalinks)." 245 msgstr "" 246 247 #: src/Admin/Support.php:44 242 248 msgid "Substitution options:" 243 249 msgstr "" 244 250 245 #: src/Admin/Support.php:4 5251 #: src/Admin/Support.php:46 246 252 msgid "the name of the region. For example, <strong>«Warsaw»</strong>." 247 253 msgstr "" 248 254 249 #: src/Admin/Support.php:46250 msgid ""251 "when talking about something that is in a region. For example, <strong>«In "252 "Warsaw»</strong>, <strong>«W Warszawie»</strong>."253 msgstr ""254 255 255 #: src/Admin/Support.php:47 256 msgid "" 257 "in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W " 258 "Warszawie»</strong>." 259 msgstr "" 260 261 #: src/Admin/Support.php:48 256 262 msgid "" 257 263 "by region. For example, <strong>«By Warsaw»</strong>, <strong>«W " … … 259 265 msgstr "" 260 266 261 #: src/Admin/Support.php:4 8267 #: src/Admin/Support.php:49 262 268 msgid "" 263 269 "from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z " … … 265 271 msgstr "" 266 272 267 #: src/Admin/Support.php: 49273 #: src/Admin/Support.php:50 268 274 msgid "phone number for the region" 269 275 msgstr "" 270 276 271 #: src/Admin/Support.php:5 0277 #: src/Admin/Support.php:51 272 278 msgid "address for the region" 273 279 msgstr "" 274 280 275 #: src/Admin/Support.php:5 1281 #: src/Admin/Support.php:52 276 282 msgid "email for the region" 277 283 msgstr "" 278 284 279 #: src/Admin/Support.php:5 2285 #: src/Admin/Support.php:53 280 286 msgid "link for the region" 281 287 msgstr "" 282 288 283 #: src/Region.php:32 0289 #: src/Region.php:324 284 290 msgid "Select a region" 285 291 msgstr "" -
geoflex/trunk/readme.txt
r3049631 r3050498 5 5 Tested up to: 6.4.2 6 6 Requires PHP: 7.4 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 26 26 27 27 * `{region_name}` the name of the region. For example, **«Warsaw»**, 28 * `{region_in}` when talking about something that isin a region. For example, **«In Warsaw»**, **«W Warszawie»**,28 * `{region_in}` in a region. For example, **«In Warsaw»**, **«W Warszawie»**, 29 29 * `{region_by}` by region. For example, **«By Warsaw»**, **«W Warszawie»**, 30 30 * `{region_from}` from the region. For example, **«From Warsaw»**, **«Z Warszawy»**, … … 42 42 3. Edit Region 43 43 4. Support 44 5. Options in the content 45 6. Regions pop-up 44 5. Options in the content (admin panel) 45 6. Options in the content (result on the website) 46 7. Regions pop-up 46 47 47 48 == Installation == … … 62 63 == Changelog == 63 64 65 = 1.2 = 66 Updated strings to translate 67 Updated instructions on the Support Page 68 64 69 = 1.1 = 65 Update Support page70 Updated Support page 66 71 67 72 = 1.0 = -
geoflex/trunk/src/Admin/Metabox.php
r3049132 r3050498 145 145 <table class="form-table" role="presentation"> 146 146 <tbody> 147 <?php foreach ($this->fields as $field): ?> 147 <?php 148 foreach ($this->fields as $field): 149 if (empty($field["id"]) || empty($field["type"]) || empty($field["label"])) { 150 continue; 151 } 152 ?> 148 153 <tr> 149 154 <th scope="row"> … … 154 159 </td> 155 160 </tr> 156 <?php endforeach; ?> 161 <?php 162 endforeach; 163 ?> 157 164 </tbody> 158 165 </table> … … 195 202 } 196 203 197 $id = $field["id"];204 $id = Helpers::get_meta_key($field["id"], false); 198 205 $type = $field["type"]; 199 206 $default = isset($field["default"] )? $field["default"] : ""; … … 317 324 foreach ($this->fields as $field) { 318 325 $id = $field["id"]; 326 327 if (empty($id)) { 328 continue; 329 } 330 331 $key = Helpers::get_meta_key($id, false); 319 332 $type = $field["type"]; 320 333 321 334 switch ($type) { 322 335 case "checkbox": 323 $value = !!array_key_exists($ id, $_POST);336 $value = !!array_key_exists($key, $_POST); 324 337 break; 325 338 case "textarea": 326 $value = array_key_exists($ id, $_POST) ? sanitize_textarea_field(wp_unslash($_POST[$id])) : false;339 $value = array_key_exists($key, $_POST) ? sanitize_textarea_field(wp_unslash($_POST[$key])) : false; 327 340 break; 328 341 case "code_css": 329 $value = array_key_exists($ id, $_POST) ? wp_unslash($_POST[$id]) : false;342 $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false; 330 343 break; 331 344 case "code_js": 332 $value = array_key_exists($ id, $_POST) ? wp_unslash($_POST[$id]) : false;345 $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false; 333 346 break; 334 347 case "code_html": 335 $value = array_key_exists($ id, $_POST) ? wp_unslash($_POST[$id]) : false;348 $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false; 336 349 break; 337 350 default: 338 $value = array_key_exists($ id, $_POST) ? sanitize_text_field(wp_unslash($_POST[$id])) : false;351 $value = array_key_exists($key, $_POST) ? sanitize_text_field(wp_unslash($_POST[$key])) : false; 339 352 } 340 353 -
geoflex/trunk/src/Admin/Support.php
r3049631 r3050498 41 41 <h3><?php esc_html_e("General options:", "geoflex"); ?></h3> 42 42 <p><?php echo wp_kses(__('To enable opening the region selection window upon clicking the link, it is necessary to add the <code>rel="region"</code> attribute.', "geoflex"), ['code' => []]); ?></p> 43 <p><?php esc_html_e("For correct work of the plugin do not use Permalink structure \"Plain\" (Setting->Permalinks).", "geoflex"); ?></p> 43 44 <h3><?php esc_html_e("Substitution options:", "geoflex"); ?></h3> 44 45 <ul> 45 46 <li><code>{region_name}</code> <?php echo wp_kses(__("the name of the region. For example, <strong>«Warsaw»</strong>.", "geoflex"), ['strong' => []]); ?></li> 46 <li><code>{region_in}</code> <?php echo wp_kses(__(" when talking about something that isin a region. For example, <strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li>47 <li><code>{region_in}</code> <?php echo wp_kses(__("in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li> 47 48 <li><code>{region_by}</code> <?php echo wp_kses(__("by region. For example, <strong>«By Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li> 48 49 <li><code>{region_from}</code> <?php echo wp_kses(__("from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z Warszawy»</strong>.", "geoflex"), ['strong' => []]); ?></li> -
geoflex/trunk/src/Plugin.php
r3049132 r3050498 96 96 $slug = preg_replace("/\./", "", str_replace($home, "", $domain)); 97 97 98 if ($slug ) {98 if ($slug && function_exists("idn_to_utf8")) { 99 99 $slug = sanitize_title(idn_to_utf8($slug)); 100 100 } -
geoflex/trunk/src/Region.php
r3049132 r3050498 103 103 // Fields replaces 104 104 foreach (Metabox::get_fields() as $field) { 105 if ( $field["type"] === "checkbox") {105 if (empty($field["id"]) || $field["type"] === "checkbox") { 106 106 continue; 107 107 } … … 215 215 public function redirect_canonical($redirect, $requested) 216 216 { 217 $redirect_domain = idn_to_ascii(wp_parse_url($redirect, PHP_URL_HOST));217 $redirect_domain = wp_parse_url($redirect, PHP_URL_HOST); 218 218 $requested_domain = wp_parse_url($requested, PHP_URL_HOST); 219 220 if (function_exists("idn_to_ascii")) { 221 $redirect_domain = idn_to_ascii($redirect_domain ); 222 } 219 223 220 224 if ($redirect_domain === $requested_domain) { -
geoflex/trunk/src/Utils/Helpers.php
r3049132 r3050498 11 11 * 12 12 * @param string $id 13 * @param mixed $underscore 13 14 * @return string 14 15 */ 15 public static function get_meta_key(string $id )16 public static function get_meta_key(string $id, bool $underscore = true) 16 17 { 17 return "_geoflex_" . $id; 18 if (empty($id)) { 19 return false; 20 } 21 22 $prefix = $underscore ? "_" : ""; 23 return $prefix . "geoflex_" . $id; 18 24 } 19 25
Note: See TracChangeset
for help on using the changeset viewer.