Plugin Directory

Changeset 3219433


Ignore:
Timestamp:
01/09/2025 07:29:46 AM (12 months ago)
Author:
pluginscafe
Message:

Add contact form 7 and more

Location:
smart-phone-field-for-wp-forms
Files:
109 added
4 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • smart-phone-field-for-wp-forms/trunk/assets/css/intlTelInput.css

    r3168518 r3219433  
    2525    position: relative;
    2626    display: inline-block;
     27    width: 100%;
    2728}
    2829
     
    12411242    }
    12421243}
     1244
     1245body div.wpforms-container-full .iti {
     1246    position: relative;
     1247    display: block;
     1248}
     1249
     1250.wpforms-pcafe-smart-phone-field input.valid {
     1251    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2347C26F" height="24px" width="24px" ><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" /></svg>');
     1252    background-repeat: no-repeat;
     1253    background-position: calc(100% - 10px) 50%;
     1254}
     1255
     1256.wpforms-pcafe-smart-phone-field input.invalid {
     1257    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23E43121" height="24px" width="24px"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd" /></svg>');
     1258    background-repeat: no-repeat;
     1259    background-position: calc(100% - 10px) 50%;
     1260}
  • smart-phone-field-for-wp-forms/trunk/readme.txt

    r3216764 r3219433  
    1 === Smart Phone Field For WP Forms ===
    2 Author: Pluginscafe
    3 Contributors: kaisarahmmed, pluginscafe
     1=== Smart Phone Field For WPForms, Contact Form 7, Fluent Forms, Elementor Form ===
     2Contributors: kaisarahmmed
    43Tags: WPForms, Smart phone field, International telephone field, International phone input, Phone field
    5 Requires at least: 5.6
     4Requires at least: 6.0
    65Requires PHP: 5.0
    7 Stable tag: 1.0.0
    8 Tested up to: 6.6.2
     6Stable tag: 1.0.1
     7Tested up to: 6.7.1
    98License: GPLv2 or later
    109License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
     
    2625
    2726== Change log ==
     27= 1.0.1 =
     28* Add settings page
     29* Global settings option
     30* Add contact form 7, Fluent forms and elementor form
     31* Bug Fix
     32
    2833= 1.0.0 =
    2934* Initial Release
  • smart-phone-field-for-wp-forms/trunk/smart-phone-field.php

    r3216764 r3219433  
    11<?php
    22/*
    3 Plugin Name: Smart Phone Field For WP Forms
    4 Plugin Url: https://pluginscafe.com/plugins/smart-phone-field
    5 Version: 1.0.0
     3Plugin Name: Smart Phone Field
     4Plugin Url: https://pluginscafe.com/plugin/smart-phone-field
     5Version: 1.0.1
    66Description: Instruct visitors to choose country code when entering their mobile number to ensure accurate and correctly formatted data submissions.
    77Author: Pluginscafe
     
    1414}
    1515
    16 define('WPFORMS_SPF_PATH', plugin_dir_path(__FILE__));
    17 define('WPFORMS_SPF_URL', plugin_dir_url(__FILE__));
    1816
    1917class PCafe_Smart_Phone_Field {
    2018
     19    const version = '1.0.1';
     20
    2121    function __construct() {
    22         add_action('wpforms_loaded', [$this, 'loads_field']);
     22        define('PCAFE_SPF_PATH', plugin_dir_path(__FILE__));
     23        define('PCAFE_SPF_URL', plugin_dir_url(__FILE__));
     24        define('PCAFE_SPF_VERSION', self::version);
     25
     26        //Plugin loaded
     27        add_action('init', [$this, 'pcafe_spf_plugin_loaded'], 9);
     28
     29        add_action('wp_enqueue_scripts', [$this, 'pcafe_spf_enqueue_scripts']);
     30
     31        add_action('activated_plugin', array($this, 'pcafe_spf_plugin_redirection'));
     32
     33        register_activation_hook(__FILE__,   [$this, 'pcafe_spf_activation']);
     34
     35        add_action('wp_head', [$this, 'pcafe_spf_global_setting']);
     36        $this->loads_field();
     37    }
     38
     39    public function pcafe_spf_enqueue_scripts() {
     40        wp_enqueue_style('pcafe_spf_intl', PCAFE_SPF_URL . 'assets/css/intlTelInput2.css', array(), PCAFE_SPF_VERSION);
     41        wp_enqueue_style('pcafe_spf_style', PCAFE_SPF_URL . 'assets/css/spf_style.css', array(), PCAFE_SPF_VERSION);
     42
     43        wp_enqueue_script('pcafe_spf_intl', PCAFE_SPF_URL . 'assets/js/intlTelInputWithUtils.min.js', array(), PCAFE_SPF_VERSION, false);
     44    }
     45
     46    public function pcafe_spf_global_setting() {
     47        if (! PCafe_SPF_Utils::instance()->active_addon_list()) return;
     48?>
     49        <script>
     50            const pcafe_spf_global_setting = <?php echo wp_json_encode(PCafe_SPF_Utils::instance()->get_settings()); ?>
     51        </script>
     52<?php
    2353    }
    2454
    2555    public function loads_field() {
    26         include WPFORMS_SPF_PATH . "includes/field.php";
     56        include PCAFE_SPF_PATH . "includes/admin/dashboard.php";
     57    }
     58
     59    function pcafe_spf_plugin_loaded() {
     60        //Register text domain
     61        load_plugin_textdomain('smart-phone-field-for-wp-forms', false, basename(dirname(__FILE__)) . '/languages');
     62    }
     63
     64    public function pcafe_spf_plugin_redirection($plugin) {
     65        if ($plugin == plugin_basename(__FILE__)) {
     66            exit(wp_safe_redirect(admin_url('admin.php?page=smart-phone-field')));
     67        }
     68    }
     69
     70    public function pcafe_spf_activation() {
     71        $saved_addon    = get_option('pcafe_spf_plugin_list');
     72        $saved_settings = get_option('pcafe_spf_global_setting');
     73        $installed = get_option('pcafe_spf_installed');
     74
     75        update_option('pcafe_spf_version', PCAFE_SPF_VERSION);
     76
     77        if (!$installed) {
     78            update_option('pcafe_spf_installed', time());
     79        }
     80
     81        if (! $saved_addon) {
     82            $addon = ['wp-forms'];
     83            update_option('pcafe_spf_plugin_list', $addon);
     84        }
     85
     86        if (! $saved_settings) {
     87            $settings = ['spf_geoip' => 'on', 'spf_default_country' => 'US', 'spf_country_search' => 'on'];
     88            update_option('pcafe_spf_global_setting', $settings);
     89        }
    2790    }
    2891}
Note: See TracChangeset for help on using the changeset viewer.