diff --git a/includes/admin/class-wp-job-manager-cpt.php b/includes/admin/class-wp-job-manager-cpt.php index 0bf0dcb07..b03d0d3e9 100644 --- a/includes/admin/class-wp-job-manager-cpt.php +++ b/includes/admin/class-wp-job-manager-cpt.php @@ -446,7 +446,7 @@ public function enter_title_here( $text, $post ) { */ public function post_updated_messages( $messages ) { global $post, $post_ID, $wp_post_types; - $wp_date_format = get_option( 'date_format' ) ?: 'F j, Y'; + $wp_date_format = get_option( 'date_format' ) ?: JOB_MANAGER_DATE_FORMAT_FALLBACK; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No changes based on input. $revision_title = isset( $_GET['revision'] ) ? wp_post_revision_title( (int) $_GET['revision'], false ) : false; diff --git a/includes/admin/class-wp-job-manager-writepanels.php b/includes/admin/class-wp-job-manager-writepanels.php index 7818a4ba4..3fe9d76bc 100644 --- a/includes/admin/class-wp-job-manager-writepanels.php +++ b/includes/admin/class-wp-job-manager-writepanels.php @@ -585,7 +585,7 @@ public function job_listing_data( $post ) { global $post, $thepostid, $wp_post_types; $thepostid = $post->ID; - $wp_date_format = get_option( 'date_format' ) ?: 'F j, Y'; + $wp_date_format = get_option( 'date_format' ) ?: JOB_MANAGER_DATE_FORMAT_FALLBACK; echo '
'; wp_nonce_field( 'save_meta_data', 'job_manager_nonce' ); diff --git a/includes/class-wp-job-manager-email-notifications.php b/includes/class-wp-job-manager-email-notifications.php index 0fee856c4..2170e2a2f 100644 --- a/includes/class-wp-job-manager-email-notifications.php +++ b/includes/class-wp-job-manager-email-notifications.php @@ -312,7 +312,7 @@ 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 ); - $wp_date_format = get_option( 'date_format' ) ?: 'F j, Y'; + $wp_date_format = get_option( 'date_format' ) ?: JOB_MANAGER_DATE_FORMAT_FALLBACK; if ( ! empty( $job_expires ) ) { $job_expires_str = wp_date( $wp_date_format, $job_expires->getTimestamp() ); $fields['job_expires'] = [ diff --git a/wp-job-manager-template.php b/wp-job-manager-template.php index 3b29bf95d..e17255937 100644 --- a/wp-job-manager-template.php +++ b/wp-job-manager-template.php @@ -759,7 +759,7 @@ function wpjm_get_registration_fields() { */ function the_job_publish_date( $post = null ) { $date_format = get_option( 'job_manager_date_format' ); - $wp_date_format = get_option( 'date_format' ) ?: 'F j, Y'; + $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( $wp_date_format, get_post_timestamp( $post ) ); @@ -788,7 +788,7 @@ function the_job_publish_date( $post = null ) { */ function get_the_job_publish_date( $post = null ) { $date_format = get_option( 'job_manager_date_format' ); - $wp_date_format = get_option( 'date_format' ) ?: 'F j, Y'; + $wp_date_format = get_option( 'date_format' ) ?: JOB_MANAGER_DATE_FORMAT_FALLBACK; if ( 'default' === $date_format ) { return wp_date( $wp_date_format, get_post_datetime()->getTimestamp() ); 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();