@@ -6,33 +6,33 @@ discard block |
||
6 | 6 | * @package GeoDirectory |
7 | 7 | */ |
8 | 8 | if (!function_exists('geodir_create_tables')) { |
9 | - /** |
|
10 | - * Creates custom db tables for storing GeoDirectory plugin data. |
|
11 | - * |
|
12 | - * @since 1.0.0 |
|
13 | - * @package GeoDirectory |
|
14 | - * @global object $wpdb WordPress Database object. |
|
15 | - * @global string $plugin_prefix GeoDirectory plugin table prefix. |
|
16 | - */ |
|
17 | - function geodir_create_tables() |
|
18 | - { |
|
19 | - |
|
20 | - global $wpdb, $plugin_prefix; |
|
21 | - |
|
22 | - $wpdb->hide_errors(); |
|
23 | - |
|
24 | - /* |
|
9 | + /** |
|
10 | + * Creates custom db tables for storing GeoDirectory plugin data. |
|
11 | + * |
|
12 | + * @since 1.0.0 |
|
13 | + * @package GeoDirectory |
|
14 | + * @global object $wpdb WordPress Database object. |
|
15 | + * @global string $plugin_prefix GeoDirectory plugin table prefix. |
|
16 | + */ |
|
17 | + function geodir_create_tables() |
|
18 | + { |
|
19 | + |
|
20 | + global $wpdb, $plugin_prefix; |
|
21 | + |
|
22 | + $wpdb->hide_errors(); |
|
23 | + |
|
24 | + /* |
|
25 | 25 | * Indexes have a maximum size of 767 bytes. Historically, we haven't need to be concerned about that. |
26 | 26 | * As of 4.2, however, we moved to utf8mb4, which uses 4 bytes per character. This means that an index which |
27 | 27 | * used to have room for floor(767/3) = 255 characters, now only has room for floor(767/4) = 191 characters. |
28 | 28 | */ |
29 | - $max_index_length = 191; |
|
29 | + $max_index_length = 191; |
|
30 | 30 | |
31 | - $collate = ''; |
|
32 | - if ($wpdb->has_cap('collation')) { |
|
33 | - if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
34 | - if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
35 | - } |
|
31 | + $collate = ''; |
|
32 | + if ($wpdb->has_cap('collation')) { |
|
33 | + if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
34 | + if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
35 | + } |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Include any functions needed for upgrades. |
@@ -43,31 +43,31 @@ discard block |
||
43 | 43 | |
44 | 44 | |
45 | 45 | // rename tables if we need to |
46 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_countries'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_countries'") == 0) { |
|
47 | - $wpdb->query("RENAME TABLE geodir_countries TO " . $wpdb->prefix . "geodir_countries"); |
|
48 | - } |
|
49 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_fields'") == 0) { |
|
50 | - $wpdb->query("RENAME TABLE geodir_custom_fields TO " . $wpdb->prefix . "geodir_custom_fields"); |
|
51 | - } |
|
52 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_icon'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_icon'") == 0) { |
|
53 | - $wpdb->query("RENAME TABLE geodir_post_icon TO " . $wpdb->prefix . "geodir_post_icon"); |
|
54 | - } |
|
55 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_attachments'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_attachments'") == 0) { |
|
56 | - $wpdb->query("RENAME TABLE geodir_attachments TO " . $wpdb->prefix . "geodir_attachments"); |
|
57 | - } |
|
58 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_review'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_review'") == 0) { |
|
59 | - $wpdb->query("RENAME TABLE geodir_post_review TO " . $wpdb->prefix . "geodir_post_review"); |
|
60 | - } |
|
61 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_sort_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_sort_fields'") == 0) { |
|
62 | - $wpdb->query("RENAME TABLE geodir_custom_sort_fields TO " . $wpdb->prefix . "geodir_custom_sort_fields"); |
|
63 | - } |
|
64 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_gd_place_detail'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_gd_place_detail'") == 0) { |
|
65 | - $wpdb->query("RENAME TABLE geodir_gd_place_detail TO " . $wpdb->prefix . "geodir_gd_place_detail"); |
|
66 | - } |
|
67 | - |
|
68 | - |
|
69 | - // Table for storing Countries |
|
70 | - $GEODIR_COUNTRIES_TABLE = "CREATE TABLE " . GEODIR_COUNTRIES_TABLE . " ( |
|
46 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_countries'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_countries'") == 0) { |
|
47 | + $wpdb->query("RENAME TABLE geodir_countries TO " . $wpdb->prefix . "geodir_countries"); |
|
48 | + } |
|
49 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_fields'") == 0) { |
|
50 | + $wpdb->query("RENAME TABLE geodir_custom_fields TO " . $wpdb->prefix . "geodir_custom_fields"); |
|
51 | + } |
|
52 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_icon'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_icon'") == 0) { |
|
53 | + $wpdb->query("RENAME TABLE geodir_post_icon TO " . $wpdb->prefix . "geodir_post_icon"); |
|
54 | + } |
|
55 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_attachments'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_attachments'") == 0) { |
|
56 | + $wpdb->query("RENAME TABLE geodir_attachments TO " . $wpdb->prefix . "geodir_attachments"); |
|
57 | + } |
|
58 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_review'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_review'") == 0) { |
|
59 | + $wpdb->query("RENAME TABLE geodir_post_review TO " . $wpdb->prefix . "geodir_post_review"); |
|
60 | + } |
|
61 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_sort_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_sort_fields'") == 0) { |
|
62 | + $wpdb->query("RENAME TABLE geodir_custom_sort_fields TO " . $wpdb->prefix . "geodir_custom_sort_fields"); |
|
63 | + } |
|
64 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_gd_place_detail'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_gd_place_detail'") == 0) { |
|
65 | + $wpdb->query("RENAME TABLE geodir_gd_place_detail TO " . $wpdb->prefix . "geodir_gd_place_detail"); |
|
66 | + } |
|
67 | + |
|
68 | + |
|
69 | + // Table for storing Countries |
|
70 | + $GEODIR_COUNTRIES_TABLE = "CREATE TABLE " . GEODIR_COUNTRIES_TABLE . " ( |
|
71 | 71 | CountryId smallint AUTO_INCREMENT NOT NULL , |
72 | 72 | Country varchar (50) NOT NULL , |
73 | 73 | FIPS104 varchar (2) NOT NULL , |
@@ -86,21 +86,21 @@ discard block |
||
86 | 86 | Comment varchar (255) NULL , |
87 | 87 | PRIMARY KEY (CountryId)) $collate "; |
88 | 88 | |
89 | - /** |
|
90 | - * Filter the SQL query that creates/updates the country DB table structure. |
|
91 | - * |
|
92 | - * @since 1.0.0 |
|
93 | - * @param string $sql The SQL insert query string. |
|
94 | - */ |
|
95 | - $GEODIR_COUNTRIES_TABLE = apply_filters('geodir_before_country_table_create', $GEODIR_COUNTRIES_TABLE); |
|
96 | - dbDelta($GEODIR_COUNTRIES_TABLE); |
|
89 | + /** |
|
90 | + * Filter the SQL query that creates/updates the country DB table structure. |
|
91 | + * |
|
92 | + * @since 1.0.0 |
|
93 | + * @param string $sql The SQL insert query string. |
|
94 | + */ |
|
95 | + $GEODIR_COUNTRIES_TABLE = apply_filters('geodir_before_country_table_create', $GEODIR_COUNTRIES_TABLE); |
|
96 | + dbDelta($GEODIR_COUNTRIES_TABLE); |
|
97 | 97 | |
98 | 98 | |
99 | - $country_table_empty = $wpdb->get_var("SELECT COUNT(CountryId) FROM " . GEODIR_COUNTRIES_TABLE . ""); |
|
99 | + $country_table_empty = $wpdb->get_var("SELECT COUNT(CountryId) FROM " . GEODIR_COUNTRIES_TABLE . ""); |
|
100 | 100 | |
101 | - if ($country_table_empty == 0) { |
|
101 | + if ($country_table_empty == 0) { |
|
102 | 102 | |
103 | - $countries_insert = "INSERT INTO " . GEODIR_COUNTRIES_TABLE . " (`CountryId`, `Country`, `FIPS104`, `ISO2`, `ISO3`, `ISON`, `Internet`, `Capital`, `MapReference`, `NationalitySingular`, `NationalityPlural`, `Currency`, `CurrencyCode`, `Population`, `Title`, `COMMENT`) VALUES |
|
103 | + $countries_insert = "INSERT INTO " . GEODIR_COUNTRIES_TABLE . " (`CountryId`, `Country`, `FIPS104`, `ISO2`, `ISO3`, `ISON`, `Internet`, `Capital`, `MapReference`, `NationalitySingular`, `NationalityPlural`, `Currency`, `CurrencyCode`, `Population`, `Title`, `COMMENT`) VALUES |
|
104 | 104 | (1, 'Afghanistan', 'AF', 'AF', 'AFG', '4', 'AF', 'Kabul ', 'Asia ', 'Afghan', 'Afghans', 'Afghani ', 'AFA', 26813057, 'Afghanistan', ''), |
105 | 105 | (2, 'Albania', 'AL', 'AL', 'ALB', '8', 'AL', 'Tirana ', 'Europe ', 'Albanian', 'Albanians', 'Lek ', 'ALL', 3510484, 'Albania', ''), |
106 | 106 | (3, 'Algeria', 'AG', 'DZ', 'DZA', '12', 'DZ', 'Algiers ', 'Africa ', 'Algerian', 'Algerians', 'Algerian Dinar ', 'DZD', 31736053, 'Algeria', ''), |
@@ -376,21 +376,21 @@ discard block |
||
376 | 376 | (281, 'South Sudan', '--', 'SS', '-- ', '--', 'SS', '', '', '', '', 'South Sudanese pound', 'SSP', 12340000, 'South Sudan', ''), |
377 | 377 | (282, 'Isle of Man', '--', 'IM', '-- ', '--', 'IM', '', '', '', '', 'Manx pound', 'IMP', 84497, 'Isle of Man', '')"; |
378 | 378 | |
379 | - /** |
|
380 | - * Filter the SQL query that inserts the country DB table data. |
|
381 | - * |
|
382 | - * @since 1.0.0 |
|
383 | - * @param string $sql The SQL insert query string. |
|
384 | - */ |
|
385 | - $countries_insert = apply_filters('geodir_before_country_data_insert', $countries_insert); |
|
386 | - $wpdb->query($countries_insert); |
|
379 | + /** |
|
380 | + * Filter the SQL query that inserts the country DB table data. |
|
381 | + * |
|
382 | + * @since 1.0.0 |
|
383 | + * @param string $sql The SQL insert query string. |
|
384 | + */ |
|
385 | + $countries_insert = apply_filters('geodir_before_country_data_insert', $countries_insert); |
|
386 | + $wpdb->query($countries_insert); |
|
387 | 387 | |
388 | - } |
|
388 | + } |
|
389 | 389 | |
390 | 390 | |
391 | - // Table for storing location attribute - these are user defined |
|
391 | + // Table for storing location attribute - these are user defined |
|
392 | 392 | |
393 | - $icon_table = "CREATE TABLE " . GEODIR_ICON_TABLE . " ( |
|
393 | + $icon_table = "CREATE TABLE " . GEODIR_ICON_TABLE . " ( |
|
394 | 394 | id int NOT NULL AUTO_INCREMENT, |
395 | 395 | post_id int( 10 ) NOT NULL, |
396 | 396 | post_title varchar(254) NOT NULL, |
@@ -399,19 +399,19 @@ discard block |
||
399 | 399 | PRIMARY KEY (id) |
400 | 400 | ) $collate "; |
401 | 401 | |
402 | - /** |
|
403 | - * Filter the SQL query that creates/updates the post_icon DB table structure. |
|
404 | - * |
|
405 | - * @since 1.0.0 |
|
406 | - * @param string $sql The SQL insert query string. |
|
407 | - */ |
|
408 | - $icon_table = apply_filters('geodir_before_icon_table_create', $icon_table); |
|
402 | + /** |
|
403 | + * Filter the SQL query that creates/updates the post_icon DB table structure. |
|
404 | + * |
|
405 | + * @since 1.0.0 |
|
406 | + * @param string $sql The SQL insert query string. |
|
407 | + */ |
|
408 | + $icon_table = apply_filters('geodir_before_icon_table_create', $icon_table); |
|
409 | 409 | |
410 | - dbDelta($icon_table); |
|
410 | + dbDelta($icon_table); |
|
411 | 411 | |
412 | - // Table for storing post custom fields - these are user defined |
|
412 | + // Table for storing post custom fields - these are user defined |
|
413 | 413 | |
414 | - $post_custom_fields = "CREATE TABLE " . GEODIR_CUSTOM_FIELDS_TABLE . " ( |
|
414 | + $post_custom_fields = "CREATE TABLE " . GEODIR_CUSTOM_FIELDS_TABLE . " ( |
|
415 | 415 | id int(11) NOT NULL AUTO_INCREMENT, |
416 | 416 | post_type varchar(100) NULL, |
417 | 417 | data_type varchar(100) NULL DEFAULT NULL, |
@@ -447,18 +447,18 @@ discard block |
||
447 | 447 | PRIMARY KEY (id) |
448 | 448 | ) $collate"; |
449 | 449 | |
450 | - /** |
|
451 | - * Filter the SQL query that creates/updates the custom_fields DB table structure. |
|
452 | - * |
|
453 | - * @since 1.0.0 |
|
454 | - * @param string $sql The SQL insert query string. |
|
455 | - */ |
|
456 | - $post_custom_fields = apply_filters('geodir_before_custom_field_table_create', $post_custom_fields); |
|
450 | + /** |
|
451 | + * Filter the SQL query that creates/updates the custom_fields DB table structure. |
|
452 | + * |
|
453 | + * @since 1.0.0 |
|
454 | + * @param string $sql The SQL insert query string. |
|
455 | + */ |
|
456 | + $post_custom_fields = apply_filters('geodir_before_custom_field_table_create', $post_custom_fields); |
|
457 | 457 | |
458 | - dbDelta($post_custom_fields); |
|
458 | + dbDelta($post_custom_fields); |
|
459 | 459 | |
460 | - // Table for storing place attribute - these are user defined |
|
461 | - $post_detail = "CREATE TABLE " . $plugin_prefix . "gd_place_detail ( |
|
460 | + // Table for storing place attribute - these are user defined |
|
461 | + $post_detail = "CREATE TABLE " . $plugin_prefix . "gd_place_detail ( |
|
462 | 462 | post_id int(11) NOT NULL, |
463 | 463 | post_title text NULL DEFAULT NULL, |
464 | 464 | post_status varchar(20) NULL DEFAULT NULL, |
@@ -487,22 +487,22 @@ discard block |
||
487 | 487 | KEY is_featured (is_featured) |
488 | 488 | ) $collate "; |
489 | 489 | |
490 | - /** |
|
491 | - * Filter the SQL query that creates/updates the post_detail DB table structure. |
|
492 | - * |
|
493 | - * @since 1.0.0 |
|
494 | - * @param string $sql The SQL insert query string. |
|
495 | - */ |
|
496 | - $post_detail = apply_filters('geodir_before_post_detail_table_create', $post_detail); |
|
490 | + /** |
|
491 | + * Filter the SQL query that creates/updates the post_detail DB table structure. |
|
492 | + * |
|
493 | + * @since 1.0.0 |
|
494 | + * @param string $sql The SQL insert query string. |
|
495 | + */ |
|
496 | + $post_detail = apply_filters('geodir_before_post_detail_table_create', $post_detail); |
|
497 | 497 | |
498 | - dbDelta($post_detail); |
|
498 | + dbDelta($post_detail); |
|
499 | 499 | |
500 | - // alter post_title |
|
501 | - //$wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_gd_place_detail MODIFY `post_title` text NULL"); |
|
500 | + // alter post_title |
|
501 | + //$wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_gd_place_detail MODIFY `post_title` text NULL"); |
|
502 | 502 | |
503 | - // Table for storing place images - these are user defined |
|
503 | + // Table for storing place images - these are user defined |
|
504 | 504 | |
505 | - $attechment_table = "CREATE TABLE " . GEODIR_ATTACHMENT_TABLE . " ( |
|
505 | + $attechment_table = "CREATE TABLE " . GEODIR_ATTACHMENT_TABLE . " ( |
|
506 | 506 | ID int(11) NOT NULL AUTO_INCREMENT, |
507 | 507 | post_id int(11) NOT NULL, |
508 | 508 | user_id int(11) DEFAULT NULL, |
@@ -518,18 +518,18 @@ discard block |
||
518 | 518 | PRIMARY KEY (ID) |
519 | 519 | ) $collate "; |
520 | 520 | |
521 | - /** |
|
522 | - * Filter the SQL query that creates/updates the attachments DB table structure. |
|
523 | - * |
|
524 | - * @since 1.0.0 |
|
525 | - * @param string $sql The SQL insert query string. |
|
526 | - */ |
|
527 | - $attechment_table = apply_filters('geodir_before_attachment_table_create', $attechment_table); |
|
521 | + /** |
|
522 | + * Filter the SQL query that creates/updates the attachments DB table structure. |
|
523 | + * |
|
524 | + * @since 1.0.0 |
|
525 | + * @param string $sql The SQL insert query string. |
|
526 | + */ |
|
527 | + $attechment_table = apply_filters('geodir_before_attachment_table_create', $attechment_table); |
|
528 | 528 | |
529 | - dbDelta($attechment_table); |
|
529 | + dbDelta($attechment_table); |
|
530 | 530 | |
531 | 531 | |
532 | - $custom_sort_fields_table = "CREATE TABLE " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " ( |
|
532 | + $custom_sort_fields_table = "CREATE TABLE " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " ( |
|
533 | 533 | id int(11) NOT NULL AUTO_INCREMENT, |
534 | 534 | post_type varchar(255) NOT NULL, |
535 | 535 | data_type varchar(255) NOT NULL, |
@@ -547,18 +547,18 @@ discard block |
||
547 | 547 | PRIMARY KEY (id) |
548 | 548 | ) $collate "; |
549 | 549 | |
550 | - /** |
|
551 | - * Filter the SQL query that creates/updates the custom_sort_fields DB table structure. |
|
552 | - * |
|
553 | - * @since 1.0.0 |
|
554 | - * @param string $sql The SQL insert query string. |
|
555 | - */ |
|
556 | - $custom_sort_fields_table = apply_filters('geodir_before_sort_fields_table_create', $custom_sort_fields_table); |
|
550 | + /** |
|
551 | + * Filter the SQL query that creates/updates the custom_sort_fields DB table structure. |
|
552 | + * |
|
553 | + * @since 1.0.0 |
|
554 | + * @param string $sql The SQL insert query string. |
|
555 | + */ |
|
556 | + $custom_sort_fields_table = apply_filters('geodir_before_sort_fields_table_create', $custom_sort_fields_table); |
|
557 | 557 | |
558 | - dbDelta($custom_sort_fields_table); |
|
558 | + dbDelta($custom_sort_fields_table); |
|
559 | 559 | |
560 | 560 | |
561 | - $review_table = "CREATE TABLE " . GEODIR_REVIEW_TABLE . " ( |
|
561 | + $review_table = "CREATE TABLE " . GEODIR_REVIEW_TABLE . " ( |
|
562 | 562 | id int(11) NOT NULL AUTO_INCREMENT, |
563 | 563 | post_id int(11) DEFAULT NULL, |
564 | 564 | post_title varchar( 255 ) NULL DEFAULT NULL, |
@@ -582,51 +582,51 @@ discard block |
||
582 | 582 | PRIMARY KEY (id) |
583 | 583 | ) $collate "; |
584 | 584 | |
585 | - /** |
|
586 | - * Filter the SQL query that creates the review DB table structure. |
|
587 | - * |
|
588 | - * @since 1.0.0 |
|
589 | - * @param string $sql The SQL insert query string. |
|
590 | - */ |
|
591 | - $review_table = apply_filters('geodir_before_review_table_create', $review_table); |
|
592 | - dbDelta($review_table); |
|
585 | + /** |
|
586 | + * Filter the SQL query that creates the review DB table structure. |
|
587 | + * |
|
588 | + * @since 1.0.0 |
|
589 | + * @param string $sql The SQL insert query string. |
|
590 | + */ |
|
591 | + $review_table = apply_filters('geodir_before_review_table_create', $review_table); |
|
592 | + dbDelta($review_table); |
|
593 | 593 | |
594 | 594 | |
595 | 595 | |
596 | - // Alter terms table |
|
597 | - $term_icon_column = $wpdb->get_var("SHOW COLUMNS FROM $wpdb->terms where field='term_icon'"); |
|
598 | - if (!$term_icon_column) { |
|
599 | - $wpdb->query("ALTER TABLE $wpdb->terms ADD `term_icon` TEXT NULL DEFAULT NULL"); |
|
600 | - } |
|
596 | + // Alter terms table |
|
597 | + $term_icon_column = $wpdb->get_var("SHOW COLUMNS FROM $wpdb->terms where field='term_icon'"); |
|
598 | + if (!$term_icon_column) { |
|
599 | + $wpdb->query("ALTER TABLE $wpdb->terms ADD `term_icon` TEXT NULL DEFAULT NULL"); |
|
600 | + } |
|
601 | 601 | |
602 | - //require_once(geodir_plugin_path() . '/upgrade.php'); |
|
602 | + //require_once(geodir_plugin_path() . '/upgrade.php'); |
|
603 | 603 | |
604 | 604 | |
605 | - } |
|
605 | + } |
|
606 | 606 | } // END MAIN FUNCTION geodir_tables_install |
607 | 607 | |
608 | 608 | if (!function_exists('geodir_create_default_fields')) { |
609 | - /** |
|
610 | - * Inserts default custom fields table data into database. |
|
611 | - * |
|
612 | - * @since 1.0.0 |
|
613 | - * @package GeoDirectory |
|
614 | - */ |
|
615 | - function geodir_create_default_fields() |
|
616 | - { |
|
617 | - |
|
618 | - $fields = geodir_default_custom_fields('gd_place'); |
|
619 | - |
|
620 | - /** |
|
621 | - * Filter the array of default custom fields DB table data. |
|
622 | - * |
|
623 | - * @since 1.0.0 |
|
624 | - * @param string $fields The default custom fields as an array. |
|
625 | - */ |
|
626 | - $fields = apply_filters('geodir_before_default_custom_fields_saved', $fields); |
|
627 | - foreach ($fields as $field_index => $field) { |
|
628 | - geodir_custom_field_save($field); |
|
609 | + /** |
|
610 | + * Inserts default custom fields table data into database. |
|
611 | + * |
|
612 | + * @since 1.0.0 |
|
613 | + * @package GeoDirectory |
|
614 | + */ |
|
615 | + function geodir_create_default_fields() |
|
616 | + { |
|
617 | + |
|
618 | + $fields = geodir_default_custom_fields('gd_place'); |
|
619 | + |
|
620 | + /** |
|
621 | + * Filter the array of default custom fields DB table data. |
|
622 | + * |
|
623 | + * @since 1.0.0 |
|
624 | + * @param string $fields The default custom fields as an array. |
|
625 | + */ |
|
626 | + $fields = apply_filters('geodir_before_default_custom_fields_saved', $fields); |
|
627 | + foreach ($fields as $field_index => $field) { |
|
628 | + geodir_custom_field_save($field); |
|
629 | 629 | |
630 | - } |
|
631 | - } |
|
630 | + } |
|
631 | + } |
|
632 | 632 | } |
633 | 633 | \ No newline at end of file |