| @@ -1,5 +1,14 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * Shared entry sidebar publish box. | |
| 4 | + * | |
| 5 | + * @package Formidable | |
| 6 | + * | |
| 7 | + * @var stdClass|null $entry Entry object (falls back to $record). | |
| 8 | + * @var stdClass|null $record Legacy entry object used when $entry is not set. | |
| 9 | + */ | |
| 10 | + | |
| 2 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | 12 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 13 | } |
| 5 | 14 | |
| @@ -4,33 +13,51 @@ | ||
| 4 | 13 | } |
| 5 | 14 | |
| 6 | 15 | if ( ! isset( $entry ) ) { |
| 7 | 16 | $entry = $record; |
| 8 | -} ?> | |
| 17 | +} | |
| 18 | +?> | |
| 9 | 19 | |
| 10 | 20 | <div class="misc-pub-section"> |
| 11 | - <?php FrmAppHelper::icon_by_class( 'frm_icon_font frm_calendar_icon', array( 'aria-hidden' => 'true' ) ); ?> | |
| 21 | + <?php FrmAppHelper::icon_by_class( 'frmfont frm_calendar_icon', array( 'aria-hidden' => 'true' ) ); ?> | |
| 12 | 22 | <span id="timestamp"> |
| 13 | 23 | <?php |
| 14 | - $date_format = __( 'M j, Y @ G:i', 'formidable' ); | |
| 24 | + | |
| 25 | + $date_format = get_option( 'date_format' ); | |
| 26 | + $date_format = $date_format ? str_replace( 'F', 'M', $date_format ) : __( 'M j, Y', 'formidable' ); | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * @since 6.25 | |
| 30 | + * | |
| 31 | + * @param string $text | |
| 32 | + * @param stdClass $entry | |
| 33 | + */ | |
| 34 | + // skipcq: PHP-W1020 | |
| 35 | + $additional_timestamp_text = apply_filters( 'frm_additional_timestamp_text', '', $entry ); | |
| 36 | + | |
| 15 | 37 | printf( |
| 16 | - /* translators: %1$s: The date */ | |
| 17 | - esc_html__( 'Submitted: %1$s', 'formidable' ), | |
| 18 | - '<b>' . esc_html( FrmAppHelper::get_localized_date( $date_format, $entry->created_at ) ) . '</b>' | |
| 38 | + /* translators: %1$s: Entry status, %2$s: <b> open tag, %3$s: The date, %4$s: Possible additional text, %5$s: </b> close tag */ | |
| 39 | + esc_html__( '%1$s: %2$s%3$s%4$s%5$s', 'formidable' ), | |
| 40 | + esc_html( FrmEntriesHelper::get_entry_status_label( $entry->is_draft ) ), | |
| 41 | + '<b>', | |
| 42 | + esc_html( FrmAppHelper::get_formatted_time( $entry->created_at, $date_format ) ), | |
| 43 | + esc_html( $additional_timestamp_text ), | |
| 44 | + '</b>' | |
| 19 | 45 | ); |
| 20 | 46 | ?> |
| 21 | 47 | </span> |
| 22 | 48 | </div> |
| 23 | 49 | |
| 50 | +<?php // phpcs:ignore Universal.Operators.StrictComparisons ?> | |
| 24 | 51 | <?php if ( $entry->updated_at && $entry->updated_at != $entry->created_at ) { ?> |
| 25 | 52 | <div class="misc-pub-section"> |
| 26 | - <?php FrmAppHelper::icon_by_class( 'frm_icon_font frm_calendar_icon', array( 'aria-hidden' => 'true' ) ); ?> | |
| 53 | + <?php FrmAppHelper::icon_by_class( 'frmfont frm_calendar_icon', array( 'aria-hidden' => 'true' ) ); ?> | |
| 27 | 54 | <span id="timestamp"> |
| 28 | 55 | <?php |
| 29 | 56 | printf( |
| 30 | 57 | /* translators: %1$s: The date */ |
| 31 | 58 | esc_html__( 'Updated: %1$s', 'formidable' ), |
| 32 | - '<b>' . esc_html( FrmAppHelper::get_localized_date( $date_format, $entry->updated_at ) ) . '</b>' | |
| 59 | + '<b>' . esc_html( FrmAppHelper::get_formatted_time( $entry->updated_at, $date_format ) ) . '</b>' | |
| 33 | 60 | ); |
| 34 | 61 | ?> |
| 35 | 62 | </span> |
| 36 | 63 | </div> |