Plugin Directory

Changeset 3085244


Ignore:
Timestamp:
05/12/2024 12:32:05 PM (20 months ago)
Author:
dshanske
Message:

Update to version 1.2.0 from GitHub

Location:
tempus-fugit
Files:
2 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • tempus-fugit/tags/1.2.0/includes/functions.php

    r2981924 r3085244  
    4242}
    4343
     44
     45
    4446/*
    4547 * Returns the date of the current archive
    4648 */
    47 function tempus_get_archive_date() {
     49function tempus_get_archive_date_query() {
    4850    if ( ! is_date() ) {
    4951        return false;
     
    6163    return array_filter( $return );
    6264}
     65
     66function tempus_get_archive_datetime() {
     67    if ( ! is_date() ) {
     68        return false;
     69    }
     70    $date = tempus_get_archive_date_query();
     71    $d    = '';
     72    if ( array_key_exists( 'year', $date ) ) {
     73        $d .= $date['year'];
     74    }
     75    if ( array_key_exists( 'monthnum', $date ) ) {
     76        if ( ! empty( $d ) ) {
     77            $d .= '-';
     78        }
     79        $d .= $date['monthnum'];
     80    }
     81    if ( array_key_exists( 'day', $date ) ) {
     82        if ( ! empty( $d ) ) {
     83            $d .= '-';
     84        }
     85        $d .= $date['day'];
     86    }
     87    if ( is_day() ) {
     88        return date_create_from_format( 'Y-m-d', $d, wp_timezone() );
     89    } elseif ( is_month() ) {
     90        return date_create_from_format( 'Y-m', $d, wp_timezone() );
     91    } elseif ( is_year() ) {
     92        return date_create_from_format( 'Y', $d, wp_timezone() );
     93    }
     94    return false;
     95}
  • tempus-fugit/tags/1.2.0/readme.txt

    r3014139 r3085244  
    22Contributors: dshanske
    33Tags: time, archive, date, onthisday
    4 Stable tag: 1.1.3
     4Stable tag: 1.2.0
    55Requires at least: 4.9.9
    66Requires PHP: 7.0
    7 Tested up to: 6.4
     7Tested up to: 6.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1111A Collection of Enhancements to Improve Time Handling on Your Site
    1212
    13 == Description == 
     13== Description ==
    1414
    1515This is a compilation of many tweaks to improve your site, including...
     
    3939
    4040== Changelog ==
     41
     42= Version 1.2.0 ( 2024-05-12 ) =
     43* Add functions for previous/next date archive that can be used in a theme
    4144
    4245= Version 1.1.3 ( 2023-12-25 ) =
  • tempus-fugit/tags/1.2.0/tempus-fugit.php

    r3014139 r3085244  
    77 * Author URI: https://david.shanske.com
    88 * Text Domain: tempus-fugit
    9  * Version: 1.1.3
     9 * Version: 1.2.0
    1010 */
    1111
     
    4040        require_once plugin_dir_path( __FILE__ ) . '/includes/rewrite-functions.php';
    4141        require_once plugin_dir_path( __FILE__ ) . '/includes/functions.php';
    42 
     42        require_once plugin_dir_path( __FILE__ ) . '/includes/date-navigation.php';
    4343        require_once plugin_dir_path( __FILE__ ) . '/includes/class-tempus-day-of-year.php';
    4444        new Tempus_Day_Of_Year();
     
    9494        flush_rewrite_rules();
    9595    }
    96 
    9796
    9897    public static function date_sort( $query ) {
  • tempus-fugit/trunk/includes/functions.php

    r2981924 r3085244  
    4242}
    4343
     44
     45
    4446/*
    4547 * Returns the date of the current archive
    4648 */
    47 function tempus_get_archive_date() {
     49function tempus_get_archive_date_query() {
    4850    if ( ! is_date() ) {
    4951        return false;
     
    6163    return array_filter( $return );
    6264}
     65
     66function tempus_get_archive_datetime() {
     67    if ( ! is_date() ) {
     68        return false;
     69    }
     70    $date = tempus_get_archive_date_query();
     71    $d    = '';
     72    if ( array_key_exists( 'year', $date ) ) {
     73        $d .= $date['year'];
     74    }
     75    if ( array_key_exists( 'monthnum', $date ) ) {
     76        if ( ! empty( $d ) ) {
     77            $d .= '-';
     78        }
     79        $d .= $date['monthnum'];
     80    }
     81    if ( array_key_exists( 'day', $date ) ) {
     82        if ( ! empty( $d ) ) {
     83            $d .= '-';
     84        }
     85        $d .= $date['day'];
     86    }
     87    if ( is_day() ) {
     88        return date_create_from_format( 'Y-m-d', $d, wp_timezone() );
     89    } elseif ( is_month() ) {
     90        return date_create_from_format( 'Y-m', $d, wp_timezone() );
     91    } elseif ( is_year() ) {
     92        return date_create_from_format( 'Y', $d, wp_timezone() );
     93    }
     94    return false;
     95}
  • tempus-fugit/trunk/readme.txt

    r3014139 r3085244  
    22Contributors: dshanske
    33Tags: time, archive, date, onthisday
    4 Stable tag: 1.1.3
     4Stable tag: 1.2.0
    55Requires at least: 4.9.9
    66Requires PHP: 7.0
    7 Tested up to: 6.4
     7Tested up to: 6.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1111A Collection of Enhancements to Improve Time Handling on Your Site
    1212
    13 == Description == 
     13== Description ==
    1414
    1515This is a compilation of many tweaks to improve your site, including...
     
    3939
    4040== Changelog ==
     41
     42= Version 1.2.0 ( 2024-05-12 ) =
     43* Add functions for previous/next date archive that can be used in a theme
    4144
    4245= Version 1.1.3 ( 2023-12-25 ) =
  • tempus-fugit/trunk/tempus-fugit.php

    r3014139 r3085244  
    77 * Author URI: https://david.shanske.com
    88 * Text Domain: tempus-fugit
    9  * Version: 1.1.3
     9 * Version: 1.2.0
    1010 */
    1111
     
    4040        require_once plugin_dir_path( __FILE__ ) . '/includes/rewrite-functions.php';
    4141        require_once plugin_dir_path( __FILE__ ) . '/includes/functions.php';
    42 
     42        require_once plugin_dir_path( __FILE__ ) . '/includes/date-navigation.php';
    4343        require_once plugin_dir_path( __FILE__ ) . '/includes/class-tempus-day-of-year.php';
    4444        new Tempus_Day_Of_Year();
     
    9494        flush_rewrite_rules();
    9595    }
    96 
    9796
    9897    public static function date_sort( $query ) {
Note: See TracChangeset for help on using the changeset viewer.