| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
if( ! class_exists( 'MywpDeveloperAbstractModule' ) ) { |
| 8 |
return false; |
| 9 |
} |
| 10 |
|
| 11 |
if ( ! class_exists( 'MywpDeveloperModuleDevDate' ) ) : |
| 12 |
|
| 13 |
final class MywpDeveloperModuleDevDate extends MywpDeveloperAbstractModule { |
| 14 |
|
| 15 |
static protected $id = 'dev_date'; |
| 16 |
|
| 17 |
static protected $priority = 90; |
| 18 |
|
| 19 |
public static function mywp_debug_renders( $debug_renders ) { |
| 20 |
|
| 21 |
$debug_renders[ self::$id ] = array( |
| 22 |
'debug_type' => 'dev', |
| 23 |
'title' => __( 'Date and Time' , 'my-wp' ), |
| 24 |
); |
| 25 |
|
| 26 |
return $debug_renders; |
| 27 |
|
| 28 |
} |
| 29 |
|
| 30 |
protected static function get_debug_lists() { |
| 31 |
|
| 32 |
$debug_lists = array( |
| 33 |
'get_option( "date_format" )' => get_option( 'date_format' ), |
| 34 |
'get_option( "time_format" )' => get_option( 'time_format' ), |
| 35 |
'get_option( "timezone_string" )' => get_option( 'timezone_string' ), |
| 36 |
'get_option( "gmt_offset" )' => get_option( 'gmt_offset' ), |
| 37 |
|
| 38 |
'date_default_timezone_get()' => date_default_timezone_get(), |
| 39 |
'ini_get( "date.timezone" )' => ini_get( 'date.timezone' ), |
| 40 |
|
| 41 |
'time()' => time(), |
| 42 |
'date( "Y-m-d H:i:s" )' => date( 'Y-m-d H:i:s' ), |
| 43 |
'date( "Y-m-d H:i:s" , time() )' => date( 'Y-m-d H:i:s' , time() ), |
| 44 |
'date( "Y-m-d H:i:s" , time() + ( get_option( "gmt_offset" ) * HOUR_IN_SECONDS ) )' => date( 'Y-m-d H:i:s' , time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ), |
| 45 |
'gmdate( "Y-m-d H:i:s" )' => gmdate( 'Y-m-d H:i:s' ), |
| 46 |
'strtotime( "now" )' => strtotime( 'now' ), |
| 47 |
'date( "Y-m-d H:i:s" , strtotime( "now" ) )' => date( 'Y-m-d H:i:s' , strtotime( 'now' ) ), |
| 48 |
|
| 49 |
'current_time( "timestamp" )' => current_time( 'timestamp' ), |
| 50 |
'current_time( "timestamp" , true )' => current_time( 'timestamp' , true ), |
| 51 |
'date( "Y-m-d H:i:s" , current_time( "timestamp" ) )' => date( 'Y-m-d H:i:s' , current_time( 'timestamp' ) ), |
| 52 |
'current_time( "mysql" )' => current_time( 'mysql' ), |
| 53 |
'current_time( "mysql" , true )' => current_time( 'mysql' , true ), |
| 54 |
|
| 55 |
'mysql2date( "G" , current_time( "mysql" ) )' => mysql2date( 'G' , current_time( 'mysql' ) ), |
| 56 |
'mysql2date( "U" , current_time( "mysql" ) )' => mysql2date( 'U' , current_time( 'mysql' ) ), |
| 57 |
'mysql2date( get_option( "date_format" ) , current_time( "mysql" ) )' => mysql2date( get_option( 'date_format' ) , current_time( 'mysql' ) ), |
| 58 |
'mysql2date( get_option( "time_format" ) , current_time( "mysql" ) )' => mysql2date( get_option( 'time_format' ) , current_time( 'mysql' ) ), |
| 59 |
'mysql2date( "l, F j, Y" , current_time( "mysql" ) )' => mysql2date( "l, F j, Y" , current_time( 'mysql' ) ), |
| 60 |
'mysql2date( "l, F j, Y" , current_time( "mysql" ) , false )' => mysql2date( "l, F j, Y" , current_time( 'mysql' ) , false ), |
| 61 |
|
| 62 |
'date_i18n( "Y-m-d H:i:s" )' => date_i18n( 'Y-m-d H:i:s' ), |
| 63 |
'date_i18n( "Y-m-d H:i:s" , false )' => date_i18n( 'Y-m-d H:i:s' , false ), |
| 64 |
'date_i18n( "Y-m-d H:i:s" , false , true )' => date_i18n( 'Y-m-d H:i:s' , false , true ), |
| 65 |
|
| 66 |
'date_i18n( "Y-m-d H:i:s" , current_time( "timestamp" ) )' => date_i18n( 'Y-m-d H:i:s' , current_time( 'timestamp' ) ), |
| 67 |
); |
| 68 |
|
| 69 |
return $debug_lists; |
| 70 |
|
| 71 |
} |
| 72 |
|
| 73 |
} |
| 74 |
|
| 75 |
MywpDeveloperModuleDevDate::init(); |
| 76 |
|
| 77 |
endif; |
| 78 |
|