Plugin Directory

Changeset 3275689


Ignore:
Timestamp:
04/17/2025 10:56:11 AM (11 months ago)
Author:
coder426
Message:

-- GFmAddon -updates for WP 6.8 --

Location:
gforms-addon-for-country-and-state-selection
Files:
17 added
3 edited

Legend:

Unmodified
Added
Removed
  • gforms-addon-for-country-and-state-selection/trunk/includes/functions.php

    r2634709 r3275689  
    5858         
    5959            $newcountrys = array_shift($newcountry);
     60            // ksort($newcountry);
     61           
     62            // $country_option = "";
     63            // $country_option .= "<option value=''>Empty (no choices selected)</option>";
     64            // $bolean = false;
     65            // $arr = array();
     66            // if($country_request == 'country'){
     67            //     foreach($newcountry as $countryname => $val_country){
     68            //         $country_option .= "<option value='{$countryname}'>{$countryname}</option>";
     69            //     }
     70            // }else{
     71            //     ksort($newcountry[$country_request]);
     72               
     73            //     foreach($newcountry[$country_request] as $countryname => $val_country){
     74            //         if($val_country == $state_request){
     75            //             $country_option .= "<option value='{$val_country}' selected>{$val_country}</option>";
     76            //         }
     77            //         $country_option .= "<option value='{$val_country}'>{$val_country}</option>";
     78            //     }
     79            // }
    6080            ksort($newcountry);
    61            
    62             $country_option = "";
    63             $country_option .= "<option value=''>Empty (no choices selected)</option>";
    64             $bolean = false;
    65             $arr = array();
    66             if($country_request == 'country'){
    67                 foreach($newcountry as $countryname => $val_country){
    68                     $country_option .= "<option value='{$countryname}'>{$countryname}</option>";
    69                 }
    70             }else{
    71                 ksort($newcountry[$country_request]);
    72                
    73                 foreach($newcountry[$country_request] as $countryname => $val_country){
    74                     if($val_country == $state_request){
    75                         $country_option .= "<option value='{$val_country}' selected>{$val_country}</option>";
    76                     }
    77                     $country_option .= "<option value='{$val_country}'>{$val_country}</option>";
    78                 }
     81
     82        $country_option = "<option value=''>Empty (no choices selected)</option>";
     83        $bolean = false;
     84        $arr = array();
     85
     86        if ($country_request === 'country') {
     87            foreach ($newcountry as $countryname => $val_country) {
     88                $country_option .= "<option value='{$countryname}'>{$countryname}</option>";
    7989            }
    80            
     90        } elseif (!empty($country_request) && isset($newcountry[$country_request])) {
     91            ksort($newcountry[$country_request]);
     92            foreach ($newcountry[$country_request] as $val_country) {
     93                $selected = ($val_country === $state_request) ? 'selected' : '';
     94                $country_option .= "<option value='{$val_country}' {$selected}>{$val_country}</option>";
     95            }
     96        }
     97
    8198            array_push($arr,$country_option);
    8299            array_push($arr,$bolean);
     
    87104    new GFCWS_Countrywisestate_Field_Ajax;
    88105?>
     106
  • gforms-addon-for-country-and-state-selection/trunk/index.php

    r2634709 r3275689  
    44 * Plugin URI:    https://plugins.hirewebxperts.com/
    55 * Description:   Country and State Selection Addon for Gravity Forms is used to add country and state dropdown fields depending on your needs. By default, all the countries of the world appear on the country select dropdown on the form and once you select any specific country, its respective states appear in the state select dropdown. All the countries and states are already available in the addon by default.
    6  * Version:       1.0
     6 * Version:       1.1
    77 * Author:        Coder426
    88 * Author URI:    https://hirewebxperts.com/
     
    1818
    1919/* Plugin details */
    20 $version             =  '1.0';
     20$version             =  '1.1';
    2121$name                =  'gforms-addon-for-country-and-state-selection';
    2222$dir_name            =  'gforms-addon-for-country-and-state-selection';
  • gforms-addon-for-country-and-state-selection/trunk/readme.txt

    r3192382 r3275689  
    44Tags: Gravity form, form, gf
    55Requires at least: 4.9.10
    6 Tested up to: 6.7
     6Tested up to: 6.8
    77Requires PHP: 8.1
    8 Stable tag: 1.0
     8Stable tag: 1.1
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3333The plugin is simple to install:
    3434
    35  * Download gforms-addon-for-country-and-state-selection.1.0.zip
     35 * Download gforms-addon-for-country-and-state-selection.1.1.zip
    3636 * Unzip
    3737 * Upload gforms-addon-for-country-and-state-selection directory to your /wp-content/plugins directory
     
    5353== Changelog ==
    5454
    55 = 1.0  - 24/Nov/2021 =
     55= 1.1 - 17/Apr/2025 =
     56- Minor bug fixed
     57
     58= 1.0 - 24/Nov/2021 =
Note: See TracChangeset for help on using the changeset viewer.