Plugin Directory

Changeset 3420634


Ignore:
Timestamp:
12/16/2025 03:51:50 AM (4 months ago)
Author:
picocodes
Message:

Update to version 1.2.5 from GitHub

Location:
hizzle-downloads
Files:
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hizzle-downloads/tags/1.2.5/hizzle-downloads.php

    r3389422 r3420634  
    44 * Plugin URI: https://hizzle.co/download-manager/
    55 * Description: A lightweight download manager plugin.
    6  * Version: 1.2.4
     6 * Version: 1.2.5
    77 * Author: Hizzle
    88 * Author URI: https://hizzle.co
  • hizzle-downloads/tags/1.2.5/readme.txt

    r3389422 r3420634  
    33Tags: files, downloads, digital downloads, download manager, restrict downloads
    44Requires at least: 4.9
    5 Tested up to: 6.7
     5Tested up to: 6.9
    66Requires PHP: 5.6
    7 Version: 1.2.4
    8 Stable tag: 1.2.4
     7Version: 1.2.5
     8Stable tag: 1.2.5
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
    11 Donate link: https://noptin.com/products/?utm_source=wp-repo&utm_medium=donate&utm_campaign=readme
     11Donate link: https://noptin.com/pricing/?utm_source=wp-repo&utm_medium=donate&utm_campaign=readme
    1212
    1313Easily add, restrict, and track digital downloads in WordPress — protect files with passwords, user roles, IPs, or subscriber access.
     
    132132== Changelog ==
    133133
     134= 1.2.5 =
     135- WordPress 6.9 compatibility.
     136- Update composer packages.
     137
    134138= 1.2.4 =
    135139- Update composer packages.
  • hizzle-downloads/tags/1.2.5/src/functions.php

    r2789854 r3420634  
    11<?php
    22
    3 use \Hizzle\Store;
    4 use \Hizzle\Downloads\Download;
    5 use \Hizzle\Downloads\Download_Log;
     3use Hizzle\Store;
     4use Hizzle\Downloads\Download;
     5use Hizzle\Downloads\Download_Log;
    66
    77/**
     
    4242    // General filter.
    4343    return apply_filters( 'hizzle_downloads_get_option', $value, $key );
    44 
    4544}
    4645
     
    6059
    6160    update_option( 'hizzle_downloads_options', $options );
    62 
    6361}
    6462
     
    7371function hizzle_downloads_get_data( $key ) {
    7472
    75     // Try fetching it from the cache.
    76     $data = wp_cache_get( "hizzle_downloads-data-$key", 'hizzle_downloads' );
    77     if ( $data ) {
    78         return $data;
    79     }
    80 
    81     $data = apply_filters( "hizzle_downloads_get_$key", include plugin_dir_path( __FILE__ ) . "data/$key.php" );
     73    // Try fetching it from the cache.
     74    $data = wp_cache_get( "hizzle_downloads-data-$key", 'hizzle_downloads' );
     75    if ( $data ) {
     76        return $data;
     77    }
     78
     79    $data = apply_filters( "hizzle_downloads_get_$key", include plugin_dir_path( __FILE__ ) . "data/$key.php" );
    8280    wp_cache_set( "hizzle_downloads-data-$key", $data, 'hizzle_downloads', MINUTE_IN_SECONDS );
    8381
     
    9492 */
    9593function hizzle_downloads_get_store() {
    96     return hizzle_downloads()->store;
     94    return hizzle_downloads()->store;
    9795}
    9896
     
    132130        return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
    133131    }
    134 
    135132}
    136133
     
    179176        return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
    180177    }
    181 
    182178}
    183179
     
    247243 */
    248244function hizzle_get_download_by_file_name( $file_name ) {
    249     return hizzle_get_download( hizzle_downloads_get_collection( 'files' )->get_id_by_prop( 'file_name', sanitize_text_field( $file_name ) ) );
     245    return hizzle_get_download( hizzle_downloads_get_collection( 'files' )->get_id_by_prop( 'file_name', sanitize_text_field( $file_name ) ) );
    250246}
    251247
     
    257253 */
    258254function hizzle_get_download_by_git_url( $git_url ) {
    259     return hizzle_get_download( hizzle_downloads_get_collection( 'files' )->get_id_by_prop( 'git_url', sanitize_text_field( strtolower( trailingslashit( $git_url ) ) ) ) );
     255    return hizzle_get_download( hizzle_downloads_get_collection( 'files' )->get_id_by_prop( 'git_url', sanitize_text_field( strtolower( trailingslashit( $git_url ) ) ) ) );
    260256}
    261257
     
    283279 */
    284280function hizzle_download_method() {
    285     $download_method = 'xsendfile';
    286 
    287     if ( get_option( 'hizzle_downloads_xsendfile_missing' ) ) {
    288         $download_method = 'force';
    289     }
     281    $download_method = 'xsendfile';
     282
     283    if ( get_option( 'hizzle_downloads_xsendfile_missing' ) ) {
     284        $download_method = 'force';
     285    }
    290286
    291287    return apply_filters( 'hizzle_download_method', $download_method );
     
    353349 */
    354350function hizzle_prepare_users_for_select() {
    355     $users = get_users(
    356         array(
    357             'fields'  => array( 'ID', 'user_login', 'display_name' ),
    358             'orderby' => 'display_name',
    359             'order'   => 'ASC',
    360         )
    361     );
    362 
    363     $prepared = array();
    364     foreach ( $users as $user ) {
    365         $prepared[ $user->ID ] = $user->display_name . ' (' . $user->user_login . ')';
    366     }
    367 
    368     return $prepared;
     351    $users = get_users(
     352        array(
     353            'fields'  => array( 'ID', 'user_login', 'display_name' ),
     354            'orderby' => 'display_name',
     355            'order'   => 'ASC',
     356        )
     357    );
     358
     359    $prepared = array();
     360    foreach ( $users as $user ) {
     361        $prepared[ $user->ID ] = $user->display_name . ' (' . $user->user_login . ')';
     362    }
     363
     364    return $prepared;
    369365}
    370366
     
    376372function hizzle_downloads_get_conditional_logic_rules() {
    377373
    378     $rules = array(
    379         'user_role'  => array(
    380             'label'       => __( 'User Role', 'hizzle-downloads' ),
    381             'description' => __( 'Restrict access to this file to specific user roles.', 'hizzle-downloads' ),
    382             'options'     => wp_roles()->get_names(),
    383         ),
    384         'user_id'    => array(
    385             'label'       => __( 'User', 'hizzle-downloads' ),
    386             'description' => __( 'Restrict access to this file to specific users.', 'hizzle-downloads' ),
    387             'options'     => hizzle_prepare_users_for_select(),
    388         ),
    389         'ip_address' => array(
    390             'label'       => __( 'IP Address', 'hizzle-downloads' ),
    391             'description' => __( 'Restrict access to this file to specific IP addresses.', 'hizzle-downloads' ),
    392         ),
    393     );
     374    $rules = array(
     375        'user_role'  => array(
     376            'label'       => __( 'User Role', 'hizzle-downloads' ),
     377            'description' => __( 'Restrict access to this file to specific user roles.', 'hizzle-downloads' ),
     378            'options'     => wp_roles()->get_names(),
     379        ),
     380        'user_id'    => array(
     381            'label'       => __( 'User', 'hizzle-downloads' ),
     382            'description' => __( 'Restrict access to this file to specific users.', 'hizzle-downloads' ),
     383            'options'     => hizzle_prepare_users_for_select(),
     384        ),
     385        'ip_address' => array(
     386            'label'       => __( 'IP Address', 'hizzle-downloads' ),
     387            'description' => __( 'Restrict access to this file to specific IP addresses.', 'hizzle-downloads' ),
     388        ),
     389    );
    394390
    395391    // Add newsletter subscription status.
     
    406402
    407403    // TODO: Add support for WooCommerce subscriptions.
    408     return apply_filters( 'hizzle_downloads_get_conditional_logic_rules', $rules );
     404    return apply_filters( 'hizzle_downloads_get_conditional_logic_rules', $rules );
    409405}
    410406
  • hizzle-downloads/tags/1.2.5/vendor/composer/installed.json

    r3389422 r3420634  
    5454        {
    5555            "name": "hizzle/store",
    56             "version": "0.2.14",
    57             "version_normalized": "0.2.14.0",
     56            "version": "0.2.15",
     57            "version_normalized": "0.2.15.0",
    5858            "source": {
    5959                "type": "git",
    6060                "url": "https://github.com/hizzle-co/datastore.git",
    61                 "reference": "3ca6f6c44defddc138797630eb428981d57dda00"
     61                "reference": "683cf2462478fc54939de9bdcb0e49e8d42ef631"
    6262            },
    6363            "dist": {
    6464                "type": "zip",
    65                 "url": "https://api.github.com/repos/hizzle-co/datastore/zipball/3ca6f6c44defddc138797630eb428981d57dda00",
    66                 "reference": "3ca6f6c44defddc138797630eb428981d57dda00",
     65                "url": "https://api.github.com/repos/hizzle-co/datastore/zipball/683cf2462478fc54939de9bdcb0e49e8d42ef631",
     66                "reference": "683cf2462478fc54939de9bdcb0e49e8d42ef631",
    6767                "shasum": ""
    6868            },
     
    7070                "php": ">=5.3.0"
    7171            },
    72             "time": "2025-11-04T05:31:14+00:00",
     72            "time": "2025-11-06T07:39:20+00:00",
    7373            "type": "library",
    7474            "installation-source": "dist",
     
    9999            "support": {
    100100                "issues": "https://github.com/hizzle-co/datastore/issues",
    101                 "source": "https://github.com/hizzle-co/datastore/tree/0.2.14"
     101                "source": "https://github.com/hizzle-co/datastore/tree/0.2.15"
    102102            },
    103103            "install-path": "../hizzle/store"
  • hizzle-downloads/tags/1.2.5/vendor/composer/installed.php

    r3389422 r3420634  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '2137b34ee0c4cc725141ea0c16a00abe71167a5e',
     6        'reference' => '614db19ce3c9720deeaa8126037216b0f26a8363',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '2137b34ee0c4cc725141ea0c16a00abe71167a5e',
     16            'reference' => '614db19ce3c9720deeaa8126037216b0f26a8363',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
     
    3030        ),
    3131        'hizzle/store' => array(
    32             'pretty_version' => '0.2.14',
    33             'version' => '0.2.14.0',
    34             'reference' => '3ca6f6c44defddc138797630eb428981d57dda00',
     32            'pretty_version' => '0.2.15',
     33            'version' => '0.2.15.0',
     34            'reference' => '683cf2462478fc54939de9bdcb0e49e8d42ef631',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../hizzle/store',
  • hizzle-downloads/tags/1.2.5/vendor/hizzle/store/src/Collection.php

    r3389422 r3420634  
    825825        foreach ( $data as $key => $value ) {
    826826
     827            $type = strtolower( $this->props[ $key ]->type ?? '' );
     828
    827829            // Handle boolean values.
    828830            if ( is_bool( $value ) ) {
     
    836838                } else {
    837839                    $value = $value->utc();
     840                }
     841            } elseif ( is_string( $value ) && $value && ( 'date' === $type || 'datetime' === $type ) ) {
     842                $datetime = new Date_Time( $value, new \DateTimeZone( 'UTC' ) );
     843                if ( 'date' === $type ) {
     844                    $value = $datetime->utc( 'Y-m-d' );
     845                } else {
     846                    $value = $datetime->utc();
    838847                }
    839848            }
     
    11211130        foreach ( $this->props as $prop ) {
    11221131
    1123             // Dates are stored in UTC time, but without a timezone.
     1132            // Date and times are stored in UTC time, but without a timezone.
    11241133            // Fix that.
    1125             if ( $prop->is_date() && ! empty( $data[ $prop->name ] ) ) {
     1134            if ( $prop->is_date_time() && ! empty( $data[ $prop->name ] ) ) {
    11261135                $data[ $prop->name ] = new Date_Time( $data[ $prop->name ], new \DateTimeZone( 'UTC' ) );
    11271136            }
  • hizzle-downloads/tags/1.2.5/vendor/hizzle/store/src/Prop.php

    r3245426 r3420634  
    509509
    510510    /**
     511     * Checks if the property value is a date time.
     512     *
     513     * @return bool
     514     */
     515    public function is_date_time() {
     516        return in_array( strtolower( $this->type ), array( 'datetime', 'timestamp' ), true );
     517    }
     518
     519    /**
    511520     * Retrieves the data type.
    512521     *
  • hizzle-downloads/tags/1.2.5/vendor/hizzle/store/src/REST_Controller.php

    r3389422 r3420634  
    15111511
    15121512                $schema[ $prop->name ] = array(
    1513                     'name'        => $prop->name,
    1514                     'label'       => $prop->label,
    1515                     'description' => $prop->description,
    1516                     'length'      => $prop->length,
    1517                     'nullable'    => $prop->nullable,
    1518                     'default'     => $prop->default,
    1519                     'enum'        => $enum,
    1520                     'readonly'    => $prop->readonly,
    1521                     'multiple'    => $prop->is_meta_key && $prop->is_meta_key_multiple,
    1522                     'is_dynamic'  => $prop->is_dynamic,
    1523                     'is_boolean'  => $prop->is_boolean(),
    1524                     'is_numeric'  => $prop->is_numeric(),
    1525                     'is_float'    => $prop->is_float(),
    1526                     'is_date'     => $prop->is_date(),
    1527                     'is_textarea' => ! $prop->is_date() && ! $prop->is_tokens && '%s' === $prop->get_data_type() && empty( $prop->length ),
    1528                     'is_meta'     => $prop->is_meta_key,
    1529                     'is_tokens'   => $prop->is_tokens,
    1530                     'js_props'    => $prop->js_props,
     1513                    'name'         => $prop->name,
     1514                    'label'        => $prop->label,
     1515                    'description'  => $prop->description,
     1516                    'length'       => $prop->length,
     1517                    'nullable'     => $prop->nullable,
     1518                    'default'      => $prop->default,
     1519                    'enum'         => $enum,
     1520                    'readonly'     => $prop->readonly,
     1521                    'multiple'     => $prop->is_meta_key && $prop->is_meta_key_multiple,
     1522                    'is_dynamic'   => $prop->is_dynamic,
     1523                    'is_boolean'   => $prop->is_boolean(),
     1524                    'is_numeric'   => $prop->is_numeric(),
     1525                    'is_float'     => $prop->is_float(),
     1526                    'is_date'      => $prop->is_date(),
     1527                    'is_date_time' => $prop->is_date_time(),
     1528                    'is_textarea'  => ! $prop->is_date() && ! $prop->is_tokens && '%s' === $prop->get_data_type() && empty( $prop->length ),
     1529                    'is_meta'      => $prop->is_meta_key,
     1530                    'is_tokens'    => $prop->is_tokens,
     1531                    'js_props'     => $prop->js_props,
    15311532                );
    15321533
  • hizzle-downloads/tags/1.2.5/vendor/hizzle/store/src/Record.php

    r3388807 r3420634  
    578578        // Set directly to the data if we have it.
    579579        if ( array_key_exists( $key, $this->data ) ) {
    580             return $prop->is_date() ? $this->set_date_prop( $prop, $value ) : $this->set_prop( $prop, $value );
     580            return $prop->is_date_time() ? $this->set_date_prop( $prop, $value ) : $this->set_prop( $prop, $value );
    581581        }
    582582
     
    884884        }
    885885
     886        if ( is_string( $value ) && $prop && strtolower( $prop->type ) === 'date' ) {
     887            return date_i18n( get_option( 'date_format' ), strtotime( $value ) );
     888        }
     889
    886890        // Arrays.
    887891        if ( ! is_scalar( $value ) ) {
     
    900904    public function display_date_value( $date, $type ) {
    901905
    902         if ( 'date' === $type ) {
     906        if ( 'date' === strtolower( $type ) ) {
    903907            return esc_html( $date->context( 'view_day' ) );
    904908        }
  • hizzle-downloads/trunk/hizzle-downloads.php

    r3389422 r3420634  
    44 * Plugin URI: https://hizzle.co/download-manager/
    55 * Description: A lightweight download manager plugin.
    6  * Version: 1.2.4
     6 * Version: 1.2.5
    77 * Author: Hizzle
    88 * Author URI: https://hizzle.co
  • hizzle-downloads/trunk/readme.txt

    r3389422 r3420634  
    33Tags: files, downloads, digital downloads, download manager, restrict downloads
    44Requires at least: 4.9
    5 Tested up to: 6.7
     5Tested up to: 6.9
    66Requires PHP: 5.6
    7 Version: 1.2.4
    8 Stable tag: 1.2.4
     7Version: 1.2.5
     8Stable tag: 1.2.5
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
    11 Donate link: https://noptin.com/products/?utm_source=wp-repo&utm_medium=donate&utm_campaign=readme
     11Donate link: https://noptin.com/pricing/?utm_source=wp-repo&utm_medium=donate&utm_campaign=readme
    1212
    1313Easily add, restrict, and track digital downloads in WordPress — protect files with passwords, user roles, IPs, or subscriber access.
     
    132132== Changelog ==
    133133
     134= 1.2.5 =
     135- WordPress 6.9 compatibility.
     136- Update composer packages.
     137
    134138= 1.2.4 =
    135139- Update composer packages.
  • hizzle-downloads/trunk/src/functions.php

    r2789854 r3420634  
    11<?php
    22
    3 use \Hizzle\Store;
    4 use \Hizzle\Downloads\Download;
    5 use \Hizzle\Downloads\Download_Log;
     3use Hizzle\Store;
     4use Hizzle\Downloads\Download;
     5use Hizzle\Downloads\Download_Log;
    66
    77/**
     
    4242    // General filter.
    4343    return apply_filters( 'hizzle_downloads_get_option', $value, $key );
    44 
    4544}
    4645
     
    6059
    6160    update_option( 'hizzle_downloads_options', $options );
    62 
    6361}
    6462
     
    7371function hizzle_downloads_get_data( $key ) {
    7472
    75     // Try fetching it from the cache.
    76     $data = wp_cache_get( "hizzle_downloads-data-$key", 'hizzle_downloads' );
    77     if ( $data ) {
    78         return $data;
    79     }
    80 
    81     $data = apply_filters( "hizzle_downloads_get_$key", include plugin_dir_path( __FILE__ ) . "data/$key.php" );
     73    // Try fetching it from the cache.
     74    $data = wp_cache_get( "hizzle_downloads-data-$key", 'hizzle_downloads' );
     75    if ( $data ) {
     76        return $data;
     77    }
     78
     79    $data = apply_filters( "hizzle_downloads_get_$key", include plugin_dir_path( __FILE__ ) . "data/$key.php" );
    8280    wp_cache_set( "hizzle_downloads-data-$key", $data, 'hizzle_downloads', MINUTE_IN_SECONDS );
    8381
     
    9492 */
    9593function hizzle_downloads_get_store() {
    96     return hizzle_downloads()->store;
     94    return hizzle_downloads()->store;
    9795}
    9896
     
    132130        return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
    133131    }
    134 
    135132}
    136133
     
    179176        return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
    180177    }
    181 
    182178}
    183179
     
    247243 */
    248244function hizzle_get_download_by_file_name( $file_name ) {
    249     return hizzle_get_download( hizzle_downloads_get_collection( 'files' )->get_id_by_prop( 'file_name', sanitize_text_field( $file_name ) ) );
     245    return hizzle_get_download( hizzle_downloads_get_collection( 'files' )->get_id_by_prop( 'file_name', sanitize_text_field( $file_name ) ) );
    250246}
    251247
     
    257253 */
    258254function hizzle_get_download_by_git_url( $git_url ) {
    259     return hizzle_get_download( hizzle_downloads_get_collection( 'files' )->get_id_by_prop( 'git_url', sanitize_text_field( strtolower( trailingslashit( $git_url ) ) ) ) );
     255    return hizzle_get_download( hizzle_downloads_get_collection( 'files' )->get_id_by_prop( 'git_url', sanitize_text_field( strtolower( trailingslashit( $git_url ) ) ) ) );
    260256}
    261257
     
    283279 */
    284280function hizzle_download_method() {
    285     $download_method = 'xsendfile';
    286 
    287     if ( get_option( 'hizzle_downloads_xsendfile_missing' ) ) {
    288         $download_method = 'force';
    289     }
     281    $download_method = 'xsendfile';
     282
     283    if ( get_option( 'hizzle_downloads_xsendfile_missing' ) ) {
     284        $download_method = 'force';
     285    }
    290286
    291287    return apply_filters( 'hizzle_download_method', $download_method );
     
    353349 */
    354350function hizzle_prepare_users_for_select() {
    355     $users = get_users(
    356         array(
    357             'fields'  => array( 'ID', 'user_login', 'display_name' ),
    358             'orderby' => 'display_name',
    359             'order'   => 'ASC',
    360         )
    361     );
    362 
    363     $prepared = array();
    364     foreach ( $users as $user ) {
    365         $prepared[ $user->ID ] = $user->display_name . ' (' . $user->user_login . ')';
    366     }
    367 
    368     return $prepared;
     351    $users = get_users(
     352        array(
     353            'fields'  => array( 'ID', 'user_login', 'display_name' ),
     354            'orderby' => 'display_name',
     355            'order'   => 'ASC',
     356        )
     357    );
     358
     359    $prepared = array();
     360    foreach ( $users as $user ) {
     361        $prepared[ $user->ID ] = $user->display_name . ' (' . $user->user_login . ')';
     362    }
     363
     364    return $prepared;
    369365}
    370366
     
    376372function hizzle_downloads_get_conditional_logic_rules() {
    377373
    378     $rules = array(
    379         'user_role'  => array(
    380             'label'       => __( 'User Role', 'hizzle-downloads' ),
    381             'description' => __( 'Restrict access to this file to specific user roles.', 'hizzle-downloads' ),
    382             'options'     => wp_roles()->get_names(),
    383         ),
    384         'user_id'    => array(
    385             'label'       => __( 'User', 'hizzle-downloads' ),
    386             'description' => __( 'Restrict access to this file to specific users.', 'hizzle-downloads' ),
    387             'options'     => hizzle_prepare_users_for_select(),
    388         ),
    389         'ip_address' => array(
    390             'label'       => __( 'IP Address', 'hizzle-downloads' ),
    391             'description' => __( 'Restrict access to this file to specific IP addresses.', 'hizzle-downloads' ),
    392         ),
    393     );
     374    $rules = array(
     375        'user_role'  => array(
     376            'label'       => __( 'User Role', 'hizzle-downloads' ),
     377            'description' => __( 'Restrict access to this file to specific user roles.', 'hizzle-downloads' ),
     378            'options'     => wp_roles()->get_names(),
     379        ),
     380        'user_id'    => array(
     381            'label'       => __( 'User', 'hizzle-downloads' ),
     382            'description' => __( 'Restrict access to this file to specific users.', 'hizzle-downloads' ),
     383            'options'     => hizzle_prepare_users_for_select(),
     384        ),
     385        'ip_address' => array(
     386            'label'       => __( 'IP Address', 'hizzle-downloads' ),
     387            'description' => __( 'Restrict access to this file to specific IP addresses.', 'hizzle-downloads' ),
     388        ),
     389    );
    394390
    395391    // Add newsletter subscription status.
     
    406402
    407403    // TODO: Add support for WooCommerce subscriptions.
    408     return apply_filters( 'hizzle_downloads_get_conditional_logic_rules', $rules );
     404    return apply_filters( 'hizzle_downloads_get_conditional_logic_rules', $rules );
    409405}
    410406
  • hizzle-downloads/trunk/vendor/composer/installed.json

    r3389422 r3420634  
    5454        {
    5555            "name": "hizzle/store",
    56             "version": "0.2.14",
    57             "version_normalized": "0.2.14.0",
     56            "version": "0.2.15",
     57            "version_normalized": "0.2.15.0",
    5858            "source": {
    5959                "type": "git",
    6060                "url": "https://github.com/hizzle-co/datastore.git",
    61                 "reference": "3ca6f6c44defddc138797630eb428981d57dda00"
     61                "reference": "683cf2462478fc54939de9bdcb0e49e8d42ef631"
    6262            },
    6363            "dist": {
    6464                "type": "zip",
    65                 "url": "https://api.github.com/repos/hizzle-co/datastore/zipball/3ca6f6c44defddc138797630eb428981d57dda00",
    66                 "reference": "3ca6f6c44defddc138797630eb428981d57dda00",
     65                "url": "https://api.github.com/repos/hizzle-co/datastore/zipball/683cf2462478fc54939de9bdcb0e49e8d42ef631",
     66                "reference": "683cf2462478fc54939de9bdcb0e49e8d42ef631",
    6767                "shasum": ""
    6868            },
     
    7070                "php": ">=5.3.0"
    7171            },
    72             "time": "2025-11-04T05:31:14+00:00",
     72            "time": "2025-11-06T07:39:20+00:00",
    7373            "type": "library",
    7474            "installation-source": "dist",
     
    9999            "support": {
    100100                "issues": "https://github.com/hizzle-co/datastore/issues",
    101                 "source": "https://github.com/hizzle-co/datastore/tree/0.2.14"
     101                "source": "https://github.com/hizzle-co/datastore/tree/0.2.15"
    102102            },
    103103            "install-path": "../hizzle/store"
  • hizzle-downloads/trunk/vendor/composer/installed.php

    r3389422 r3420634  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '2137b34ee0c4cc725141ea0c16a00abe71167a5e',
     6        'reference' => '614db19ce3c9720deeaa8126037216b0f26a8363',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '2137b34ee0c4cc725141ea0c16a00abe71167a5e',
     16            'reference' => '614db19ce3c9720deeaa8126037216b0f26a8363',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
     
    3030        ),
    3131        'hizzle/store' => array(
    32             'pretty_version' => '0.2.14',
    33             'version' => '0.2.14.0',
    34             'reference' => '3ca6f6c44defddc138797630eb428981d57dda00',
     32            'pretty_version' => '0.2.15',
     33            'version' => '0.2.15.0',
     34            'reference' => '683cf2462478fc54939de9bdcb0e49e8d42ef631',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../hizzle/store',
  • hizzle-downloads/trunk/vendor/hizzle/store/src/Collection.php

    r3389422 r3420634  
    825825        foreach ( $data as $key => $value ) {
    826826
     827            $type = strtolower( $this->props[ $key ]->type ?? '' );
     828
    827829            // Handle boolean values.
    828830            if ( is_bool( $value ) ) {
     
    836838                } else {
    837839                    $value = $value->utc();
     840                }
     841            } elseif ( is_string( $value ) && $value && ( 'date' === $type || 'datetime' === $type ) ) {
     842                $datetime = new Date_Time( $value, new \DateTimeZone( 'UTC' ) );
     843                if ( 'date' === $type ) {
     844                    $value = $datetime->utc( 'Y-m-d' );
     845                } else {
     846                    $value = $datetime->utc();
    838847                }
    839848            }
     
    11211130        foreach ( $this->props as $prop ) {
    11221131
    1123             // Dates are stored in UTC time, but without a timezone.
     1132            // Date and times are stored in UTC time, but without a timezone.
    11241133            // Fix that.
    1125             if ( $prop->is_date() && ! empty( $data[ $prop->name ] ) ) {
     1134            if ( $prop->is_date_time() && ! empty( $data[ $prop->name ] ) ) {
    11261135                $data[ $prop->name ] = new Date_Time( $data[ $prop->name ], new \DateTimeZone( 'UTC' ) );
    11271136            }
  • hizzle-downloads/trunk/vendor/hizzle/store/src/Prop.php

    r3245426 r3420634  
    509509
    510510    /**
     511     * Checks if the property value is a date time.
     512     *
     513     * @return bool
     514     */
     515    public function is_date_time() {
     516        return in_array( strtolower( $this->type ), array( 'datetime', 'timestamp' ), true );
     517    }
     518
     519    /**
    511520     * Retrieves the data type.
    512521     *
  • hizzle-downloads/trunk/vendor/hizzle/store/src/REST_Controller.php

    r3389422 r3420634  
    15111511
    15121512                $schema[ $prop->name ] = array(
    1513                     'name'        => $prop->name,
    1514                     'label'       => $prop->label,
    1515                     'description' => $prop->description,
    1516                     'length'      => $prop->length,
    1517                     'nullable'    => $prop->nullable,
    1518                     'default'     => $prop->default,
    1519                     'enum'        => $enum,
    1520                     'readonly'    => $prop->readonly,
    1521                     'multiple'    => $prop->is_meta_key && $prop->is_meta_key_multiple,
    1522                     'is_dynamic'  => $prop->is_dynamic,
    1523                     'is_boolean'  => $prop->is_boolean(),
    1524                     'is_numeric'  => $prop->is_numeric(),
    1525                     'is_float'    => $prop->is_float(),
    1526                     'is_date'     => $prop->is_date(),
    1527                     'is_textarea' => ! $prop->is_date() && ! $prop->is_tokens && '%s' === $prop->get_data_type() && empty( $prop->length ),
    1528                     'is_meta'     => $prop->is_meta_key,
    1529                     'is_tokens'   => $prop->is_tokens,
    1530                     'js_props'    => $prop->js_props,
     1513                    'name'         => $prop->name,
     1514                    'label'        => $prop->label,
     1515                    'description'  => $prop->description,
     1516                    'length'       => $prop->length,
     1517                    'nullable'     => $prop->nullable,
     1518                    'default'      => $prop->default,
     1519                    'enum'         => $enum,
     1520                    'readonly'     => $prop->readonly,
     1521                    'multiple'     => $prop->is_meta_key && $prop->is_meta_key_multiple,
     1522                    'is_dynamic'   => $prop->is_dynamic,
     1523                    'is_boolean'   => $prop->is_boolean(),
     1524                    'is_numeric'   => $prop->is_numeric(),
     1525                    'is_float'     => $prop->is_float(),
     1526                    'is_date'      => $prop->is_date(),
     1527                    'is_date_time' => $prop->is_date_time(),
     1528                    'is_textarea'  => ! $prop->is_date() && ! $prop->is_tokens && '%s' === $prop->get_data_type() && empty( $prop->length ),
     1529                    'is_meta'      => $prop->is_meta_key,
     1530                    'is_tokens'    => $prop->is_tokens,
     1531                    'js_props'     => $prop->js_props,
    15311532                );
    15321533
  • hizzle-downloads/trunk/vendor/hizzle/store/src/Record.php

    r3388807 r3420634  
    578578        // Set directly to the data if we have it.
    579579        if ( array_key_exists( $key, $this->data ) ) {
    580             return $prop->is_date() ? $this->set_date_prop( $prop, $value ) : $this->set_prop( $prop, $value );
     580            return $prop->is_date_time() ? $this->set_date_prop( $prop, $value ) : $this->set_prop( $prop, $value );
    581581        }
    582582
     
    884884        }
    885885
     886        if ( is_string( $value ) && $prop && strtolower( $prop->type ) === 'date' ) {
     887            return date_i18n( get_option( 'date_format' ), strtotime( $value ) );
     888        }
     889
    886890        // Arrays.
    887891        if ( ! is_scalar( $value ) ) {
     
    900904    public function display_date_value( $date, $type ) {
    901905
    902         if ( 'date' === $type ) {
     906        if ( 'date' === strtolower( $type ) ) {
    903907            return esc_html( $date->context( 'view_day' ) );
    904908        }
Note: See TracChangeset for help on using the changeset viewer.