';
wp_nonce_field( 'save_meta_data', 'job_manager_nonce' );
@@ -618,7 +618,7 @@ public function job_listing_data( $post ) {
// translators: %1$s is placeholder for singular name of the job listing post type; %2$s is the intl formatted date the listing was last modified.
esc_html__( '%1$s was last modified by the user on %2$s.', 'wp-job-manager' ),
esc_html( $wp_post_types[ \WP_Job_Manager_Post_Types::PT_LISTING ]->labels->singular_name ),
- esc_html( wp_date( get_option( 'date_format' ), (int) $user_edited_timestamp ) )
+ esc_html( wp_date( $wp_date_format, (int) $user_edited_timestamp ) )
);
echo '';
echo '';
diff --git a/includes/class-wp-job-manager-email-notifications.php b/includes/class-wp-job-manager-email-notifications.php
index 38ea63dbc..2f8a3e570 100644
--- a/includes/class-wp-job-manager-email-notifications.php
+++ b/includes/class-wp-job-manager-email-notifications.php
@@ -311,9 +311,10 @@ private static function get_job_detail_fields( WP_Post $job, $sent_to_admin, $pl
];
}
- $job_expires = WP_Job_Manager_Post_Types::instance()->get_job_expiration( $job );
+ $job_expires = WP_Job_Manager_Post_Types::instance()->get_job_expiration( $job );
+ $wp_date_format = get_option( 'date_format' ) ?: JOB_MANAGER_DATE_FORMAT_FALLBACK;
if ( ! empty( $job_expires ) ) {
- $job_expires_str = wp_date( get_option( 'date_format' ), $job_expires->getTimestamp() );
+ $job_expires_str = wp_date( $wp_date_format, $job_expires->getTimestamp() );
$fields['job_expires'] = [
'label' => __( 'Listing expires', 'wp-job-manager' ),
'value' => $job_expires_str,
diff --git a/templates/job-dashboard.php b/templates/job-dashboard.php
index cba5b6230..60f98a6d4 100644
--- a/templates/job-dashboard.php
+++ b/templates/job-dashboard.php
@@ -25,6 +25,7 @@
$submission_limit = ! empty( get_option( 'job_manager_submission_limit' ) ) ? absint( get_option( 'job_manager_submission_limit' ) ) : false;
$submit_job_form_page_id = get_option( 'job_manager_submit_job_form_page_id' );
+$wp_date_format = get_option( 'date_format' ) ?: 'F j, Y';
?>
@@ -73,11 +74,11 @@
?>
- getTimestamp() ) ); ?>
+ getTimestamp() ) ); ?>
get_job_expiration( $job );
- echo esc_html( $job_expires ? wp_date( get_option( 'date_format' ), $job_expires->getTimestamp() ) : '–' );
+ echo esc_html( $job_expires ? wp_date( $wp_date_format, $job_expires->getTimestamp() ) : '–' );
?>
diff --git a/wp-job-manager-template.php b/wp-job-manager-template.php
index 7a0ce1a19..e17255937 100644
--- a/wp-job-manager-template.php
+++ b/wp-job-manager-template.php
@@ -758,10 +758,11 @@ function wpjm_get_registration_fields() {
* @param int|WP_Post $post (default: null).
*/
function the_job_publish_date( $post = null ) {
- $date_format = get_option( 'job_manager_date_format' );
+ $date_format = get_option( 'job_manager_date_format' );
+ $wp_date_format = get_option( 'date_format' ) ?: JOB_MANAGER_DATE_FORMAT_FALLBACK;
if ( 'default' === $date_format ) {
- $display_date = esc_html__( 'Posted on ', 'wp-job-manager' ) . wp_date( get_option( 'date_format' ), get_post_timestamp( $post ) );
+ $display_date = esc_html__( 'Posted on ', 'wp-job-manager' ) . wp_date( $wp_date_format, get_post_timestamp( $post ) );
} else {
$post_timestamp = get_post_timestamp( $post );
$current_time = time();
@@ -786,10 +787,11 @@ function the_job_publish_date( $post = null ) {
* @return string|int|false
*/
function get_the_job_publish_date( $post = null ) {
- $date_format = get_option( 'job_manager_date_format' );
+ $date_format = get_option( 'job_manager_date_format' );
+ $wp_date_format = get_option( 'date_format' ) ?: JOB_MANAGER_DATE_FORMAT_FALLBACK;
if ( 'default' === $date_format ) {
- return wp_date( get_option( 'date_format' ), get_post_datetime()->getTimestamp() );
+ return wp_date( $wp_date_format, get_post_datetime()->getTimestamp() );
} else {
// translators: Placeholder %s is the relative, human readable time since the job listing was posted.
return sprintf( __( 'Posted %s ago', 'wp-job-manager' ), human_time_diff( get_post_timestamp(), time() ) );
diff --git a/wp-job-manager.php b/wp-job-manager.php
index fbb25f095..fc91ac7dd 100644
--- a/wp-job-manager.php
+++ b/wp-job-manager.php
@@ -25,6 +25,7 @@
define( 'JOB_MANAGER_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'JOB_MANAGER_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
define( 'JOB_MANAGER_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
+define( 'JOB_MANAGER_DATE_FORMAT_FALLBACK', 'F j, Y' );
require_once dirname( __FILE__ ) . '/wp-job-manager-autoload.php';
WP_Job_Manager_Autoload::init();