diff --git a/app/Helpers/DateTime.php b/app/Helpers/DateTime.php index 685c11ee5..6bc751bee 100644 --- a/app/Helpers/DateTime.php +++ b/app/Helpers/DateTime.php @@ -70,7 +70,7 @@ public function to_string() { } public function to_date_time_string() { - return $this->format( formgent_date_time_format() ); + return $this->format( directorist_date_time_format() ); } public function create_from_format( string $format, string $datetime, ?DateTimeZone $timezone = null ) { @@ -84,7 +84,7 @@ public function add_timestamp( int $time ) { } public function wp_date_time_string( string $date_time ) { - $this->create_from_format( formgent_date_time_format(), $date_time ); + $this->create_from_format( directorist_date_time_format(), $date_time ); $format = get_option( 'date_format' ) . ' \a\t ' . get_option( 'time_format' ); return $this->format( $format ); } diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php index ebd3220cf..c027c3687 100644 --- a/app/Helpers/helpers.php +++ b/app/Helpers/helpers.php @@ -72,4 +72,8 @@ function directorist_set_listing_status( int $listing_id, string $status ): bool function directorist_get_directory_by_slug( string $slug ) { $directory = get_term_by( 'slug', $slug, 'atbdp_listing_types' ); return $directory ? $directory : null; +} + +function directorist_date_time_format() { + return apply_filters( 'directorist_date_time_format', 'Y-m-d H:i:s' ); } \ No newline at end of file