Changeset 3085244
- Timestamp:
- 05/12/2024 12:32:05 PM (20 months ago)
- Location:
- tempus-fugit
- Files:
-
- 2 added
- 6 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from tempus-fugit/trunk)
-
tags/1.2.0/includes/date-navigation.php (added)
-
tags/1.2.0/includes/functions.php (modified) (2 diffs)
-
tags/1.2.0/readme.txt (modified) (3 diffs)
-
tags/1.2.0/tempus-fugit.php (modified) (3 diffs)
-
trunk/includes/date-navigation.php (added)
-
trunk/includes/functions.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/tempus-fugit.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tempus-fugit/tags/1.2.0/includes/functions.php
r2981924 r3085244 42 42 } 43 43 44 45 44 46 /* 45 47 * Returns the date of the current archive 46 48 */ 47 function tempus_get_archive_date () {49 function tempus_get_archive_date_query() { 48 50 if ( ! is_date() ) { 49 51 return false; … … 61 63 return array_filter( $return ); 62 64 } 65 66 function 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 2 2 Contributors: dshanske 3 3 Tags: time, archive, date, onthisday 4 Stable tag: 1. 1.34 Stable tag: 1.2.0 5 5 Requires at least: 4.9.9 6 6 Requires PHP: 7.0 7 Tested up to: 6. 47 Tested up to: 6.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 11 11 A Collection of Enhancements to Improve Time Handling on Your Site 12 12 13 == Description == 13 == Description == 14 14 15 15 This is a compilation of many tweaks to improve your site, including... … … 39 39 40 40 == 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 41 44 42 45 = Version 1.1.3 ( 2023-12-25 ) = -
tempus-fugit/tags/1.2.0/tempus-fugit.php
r3014139 r3085244 7 7 * Author URI: https://david.shanske.com 8 8 * Text Domain: tempus-fugit 9 * Version: 1. 1.39 * Version: 1.2.0 10 10 */ 11 11 … … 40 40 require_once plugin_dir_path( __FILE__ ) . '/includes/rewrite-functions.php'; 41 41 require_once plugin_dir_path( __FILE__ ) . '/includes/functions.php'; 42 42 require_once plugin_dir_path( __FILE__ ) . '/includes/date-navigation.php'; 43 43 require_once plugin_dir_path( __FILE__ ) . '/includes/class-tempus-day-of-year.php'; 44 44 new Tempus_Day_Of_Year(); … … 94 94 flush_rewrite_rules(); 95 95 } 96 97 96 98 97 public static function date_sort( $query ) { -
tempus-fugit/trunk/includes/functions.php
r2981924 r3085244 42 42 } 43 43 44 45 44 46 /* 45 47 * Returns the date of the current archive 46 48 */ 47 function tempus_get_archive_date () {49 function tempus_get_archive_date_query() { 48 50 if ( ! is_date() ) { 49 51 return false; … … 61 63 return array_filter( $return ); 62 64 } 65 66 function 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 2 2 Contributors: dshanske 3 3 Tags: time, archive, date, onthisday 4 Stable tag: 1. 1.34 Stable tag: 1.2.0 5 5 Requires at least: 4.9.9 6 6 Requires PHP: 7.0 7 Tested up to: 6. 47 Tested up to: 6.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 11 11 A Collection of Enhancements to Improve Time Handling on Your Site 12 12 13 == Description == 13 == Description == 14 14 15 15 This is a compilation of many tweaks to improve your site, including... … … 39 39 40 40 == 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 41 44 42 45 = Version 1.1.3 ( 2023-12-25 ) = -
tempus-fugit/trunk/tempus-fugit.php
r3014139 r3085244 7 7 * Author URI: https://david.shanske.com 8 8 * Text Domain: tempus-fugit 9 * Version: 1. 1.39 * Version: 1.2.0 10 10 */ 11 11 … … 40 40 require_once plugin_dir_path( __FILE__ ) . '/includes/rewrite-functions.php'; 41 41 require_once plugin_dir_path( __FILE__ ) . '/includes/functions.php'; 42 42 require_once plugin_dir_path( __FILE__ ) . '/includes/date-navigation.php'; 43 43 require_once plugin_dir_path( __FILE__ ) . '/includes/class-tempus-day-of-year.php'; 44 44 new Tempus_Day_Of_Year(); … … 94 94 flush_rewrite_rules(); 95 95 } 96 97 96 98 97 public static function date_sort( $query ) {
Note: See TracChangeset
for help on using the changeset viewer.