Plugin Directory

Changeset 3257744


Ignore:
Timestamp:
03/18/2025 11:12:18 AM (13 months ago)
Author:
sanzeeb3
Message:

Birthday 1.5.5

Location:
birthday/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • birthday/trunk/birthday.php

    r3229170 r3257744  
    44 * Plugin Name: Birthday
    55 * Description: Enhance your customer experience with WooCommerce Birthday and start offering personalized birthday promotions!
    6  * Version: 1.5.4
     6 * Version: 1.5.5
    77 * Requires Plugins: woocommerce
    88 * Author: Mini Plugins
     
    6060    define( 'BIRTHDAY_PLUGIN_FILE', __FILE__ );
    6161    define( 'BIRTHDAY_PLUGIN_PATH', __DIR__ );
    62     define( 'BIRTHDAY_VERSION', '1.5.4' );
     62    define( 'BIRTHDAY_VERSION', '1.5.5' );
    6363    require_once __DIR__ . '/src/Plugin.php';
    6464    /**
  • birthday/trunk/readme.txt

    r3229170 r3257744  
    44Requires at least: 6.0
    55Tested up to: 6.7
    6 Stable tag: 1.5.4
     6Stable tag: 1.5.5
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4848== Changelog ==
    4949
     50= 1.5.5 - 3/18/2025 =
     51* New - Flatpickr for date field
     52
    5053= 1.5.4 - 1/27/2024 =
    5154* Tweak - Freemius SDK update
  • birthday/trunk/src/Plugin.php

    r3229170 r3257744  
    5555
    5656    /**
     57     * Add Flatpickr for the date field.
     58     */
     59    public function flatpickr() {
     60        wp_enqueue_style('flatpickr', plugins_url( 'assets/flatpickr.min.css', BIRTHDAY_PLUGIN_FILE ), [], BIRTHDAY_VERSION );
     61        wp_enqueue_script('flatpickr', plugins_url( 'assets/flatpickr.min.js', BIRTHDAY_PLUGIN_FILE ), array('jquery'), BIRTHDAY_VERSION, false);
     62
     63        ?>
     64            <script>
     65                jQuery(document).ready(function($) {
     66                    $('#billing_birthday, #account_birthday').flatpickr();
     67                });
     68            </script>
     69        <?php
     70    }
     71
     72    /**
    5773     * Load Localisation files.
    5874     *
     
    158174    public function add_birthday_field_to_checkout( $fields ) {
    159175
     176        $this->flatpickr();
     177
    160178        $fields['billing_birthday'] = array(
    161179            'type'         => 'date',
    162180            'label'        => apply_filters( 'birthday_for_woocommerce_checkout_label', __( 'Birthday', 'birthday' ) ),
    163             'description'  => apply_filters( 'birthday_for_woocommerce_checkout_description', __( 'Enter your birthday in case you\'d like to receive cool gifts, discounts etc. from us in your birthday', 'birthday' ) ),
     181            'description'  => apply_filters( 'birthday_for_woocommerce_checkout_description', __( '', 'birthday' ) ),
    164182            'class'        => array( 'form-row-wide' ),
    165183            'autocomplete' => 'birthday',
     
    182200    public function add_birthday_field_to_customer_billing_address( $fields ) {
    183201
     202        $this->flatpickr();
     203
    184204        $fields['billing']['fields']['billing_birthday'] = array(
    185205            'label'       => __( 'Birthday', 'birthday' ),
     
    197217    public function add_birthday_field_to_account_page() {
    198218
     219        $this->flatpickr();
     220
    199221        $user_id       = get_current_user_id();
    200222        $user_birthday = get_user_meta( $user_id, 'billing_birthday', true );
Note: See TracChangeset for help on using the changeset viewer.