Plugin Directory

Changeset 3384622


Ignore:
Timestamp:
10/26/2025 07:06:43 AM (5 months ago)
Author:
pluginscafe
Message:

added contact form 7

Location:
advanced-date-time-field
Files:
131 added
6 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • advanced-date-time-field/trunk/advanced-date-time-field.php

    r3228630 r3384622  
    66Author: Pluginscafe
    77Author URI: https://pluginscafe.com
    8 Version: 1.0.0
     8Version: 1.0.1
    99Description: This plugin is a lightweight yet powerful date and time picker designed for popular form builder plugins.
    1010Text Domain: advanced-date-time-field
     
    1616}
    1717
    18 define('ADTF_VERSION', '1.0.0');
     18class Advanced_date_time_field {
     19    public const VERSION = '1.0.1';
    1920
    20 add_action('gform_loaded', array('ADTF_Bootstrap', 'load'), 5);
    21 class ADTF_Bootstrap {
    22     public static function load() {
    23         if (!method_exists('GFForms', 'include_addon_framework')) {
    24             return;
     21    public function __construct() {
     22        $this->define_constants();
     23        $this->loads_field();
     24
     25        add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']);
     26        add_action('activated_plugin', array($this, 'adtf_redirection'));
     27
     28        register_activation_hook(__FILE__,   [$this, 'adtf_activation']);
     29    }
     30
     31    public function define_constants() {
     32        define('ADTF_VERSION', self::VERSION);
     33        define('ADTF_FILE', __FILE__);
     34        define('ADTF_PATH', __DIR__);
     35        define('ADTF_URL', plugins_url('', ADTF_FILE));
     36        define('ADTF_AEESTS', ADTF_URL . '/assets');
     37    }
     38
     39    public function enqueue_scripts() {
     40        wp_enqueue_style('adtf-flatpickr', ADTF_AEESTS . '/css/flatpickr.min.css', [], ADTF_VERSION);
     41        wp_enqueue_style('adtf-style', ADTF_AEESTS . '/css/adtf_style.css', [], ADTF_VERSION);
     42        wp_enqueue_script('adtf-flatpickr', ADTF_AEESTS . '/js/flatpickr.min.js', ['jquery'], ADTF_VERSION, true);
     43    }
     44
     45    public function adtf_redirection($plugin) {
     46        if ($plugin == plugin_basename(__FILE__)) {
     47            wp_safe_redirect(admin_url('admin.php?page=advanced-date-time-field'));
     48            exit;
    2549        }
    26         // are we on GF 2.8+
    27         require_once 'includes/class-adtf-addon.php';
    28         require_once 'includes/class-adtf-field.php';
    29         require_once 'includes/class-adtf-editor.php';
    30         GFAddOn::register('ADTF_Addon');
     50    }
     51
     52    public function adtf_activation() {
     53        $saved_addon    = get_option('adtf_integrations');
     54        $installed = get_option('adtf_installed');
     55
     56        update_option('adtf_version', ADTF_VERSION);
     57
     58        if (!$installed) {
     59            update_option('adtf_installed', time());
     60        }
     61
     62        if (! $saved_addon) {
     63            $addon = ['contact-form-7'];
     64            update_option('adtf_integrations', $addon);
     65        }
     66    }
     67
     68    public function loads_field() {
     69        include_once ADTF_PATH . "/includes/admin/class-admin-dashboard.php";
    3170    }
    3271}
    3372
    34 /**
    35  * Initializes the PCAFE_GFDT_Addon instance.
    36  *
    37  * @return ADTF_Addon The initialized instance of the add-on.
    38  */
    39 function ADTF_Instance() {
    40     return ADTF_Addon::get_instance();
    41 }
     73new Advanced_date_time_field();
  • advanced-date-time-field/trunk/readme.txt

    r3228630 r3384622  
    1 === Advanced Date Time Field ===
     1=== Advanced Date Time Field For Contact Form 7, Gravity Forms, WPForms ===
    22Author: Pluginscafe
    33Contributors: kaisarahmmed, pluginscafe
    44Tags: datetime, date, time, addon, input field
    5 Tested up to: 6.7
    6 Stable tag: 1.0.0
     5Tested up to: 6.8
     6Stable tag: 1.0.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424== Changelog ==
    2525
     26= 1.0.1 =
     27* Added WPForms and Contact Form 7
     28* Added more options
     29* Added dashboard
     30
    2631= 1.0.0 =
    2732* Added a Date Time field for Gravity form
Note: See TracChangeset for help on using the changeset viewer.