Skip to content

Commit

Permalink
Replace get_option('date_format') with give_date_format core function
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinderk committed Aug 24, 2016
1 parent 9197a23 commit a8bcd70
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion includes/admin/customers/class-customer-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function column_default( $item, $column_name ) {
break;

case 'date_created' :
$value = date_i18n( get_option( 'date_format' ), strtotime( $item['date_created'] ) );
$value = date_i18n( give_date_format(), strtotime( $item['date_created'] ) );
break;

default:
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/customers/customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function give_customers_view( $customer ) {
</div>
<p class="customer-since info-item">
<?php esc_html_e( 'Donor since', 'give' ); ?>
<?php echo date_i18n( get_option( 'date_format' ), strtotime( $customer->date_created ) ) ?>
<?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?>
</p>
<?php if ( current_user_can( $customer_edit_role ) ): ?>
<a href="#" id="edit-customer" class="button info-item editable customer-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a>
Expand Down Expand Up @@ -458,7 +458,7 @@ function give_customers_view( $customer ) {
<tr>
<td><?php echo $payment->ID; ?></td>
<td><?php echo give_payment_amount( $payment->ID ); ?></td>
<td><?php echo date_i18n( get_option( 'date_format' ), strtotime( $payment->post_date ) ); ?></td>
<td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td>
<td><?php echo give_get_payment_status( $payment, true ); ?></td>
<td>
<a aria-label="<?php sprintf( esc_attr_e( 'View Details for Donation %s.', 'give' ), $payment->ID ); ?>" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $payment->ID ); ?>">
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/payments/class-payments-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public function column_default( $payment, $column_name ) {

case 'date' :
$date = strtotime( $payment->date );
$value = date_i18n( get_option( 'date_format' ), $date );
$value = date_i18n( give_date_format(), $date );
break;

case 'status' :
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/payments/view-order-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
<div class="column">
<p>
<strong><?php esc_html_e( 'Donation Date:', 'give' ); ?></strong><br>
<?php echo date_i18n( get_option( 'date_format' ), $payment_date ); ?>
<?php echo date_i18n( give_date_format(), $payment_date ); ?>
</p>
<p>
<strong><?php esc_html_e( 'Donation Level:', 'give' ); ?></strong><br>
Expand Down Expand Up @@ -498,7 +498,7 @@
</p>
<p>
<strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br>
<?php echo date_i18n( get_option( 'date_format' ), strtotime( $customer->date_created ) ) ?>
<?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?>
</p>
</div>
<div class="column">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private function set_donor_data( $i, $data, $donor ) {
$data[ $i ]['userid'] = ! empty( $donor->user_id ) ? $donor->user_id : '';
}
if ( ! empty( $columns['date_first_donated'] ) ) {
$data[ $i ]['date_first_donated'] = date_i18n( get_option( 'date_format' ), strtotime( $donor->date_created ) );
$data[ $i ]['date_first_donated'] = date_i18n( give_date_format(), strtotime( $donor->date_created ) );
}
if ( ! empty( $columns['donations'] ) ) {
$data[ $i ]['donations'] = $donor->purchase_count;
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/reporting/pdf-reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function give_generate_pdf( $data ) {
sprintf(
/* translators: 1: start date 2: end date */
esc_html__( '%1$s to %2$s', 'give' ),
date_i18n( get_option( 'date_format' ), mktime( 0, 0, 0, 1, 1, date( 'Y' ) ) ),
date_i18n( get_option( 'date_format' ) )
date_i18n( give_date_format(), mktime( 0, 0, 0, 1, 1, date( 'Y' ) ) ),
date_i18n( give_date_format() )
)
);

Expand Down
2 changes: 1 addition & 1 deletion includes/emails/class-give-email-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ function give_email_tag_billing_address( $payment_id ) {
function give_email_tag_date( $payment_id ) {
$payment = new Give_Payment( $payment_id );

return date_i18n( get_option( 'date_format' ), strtotime( $payment->date ) );
return date_i18n( give_date_format(), strtotime( $payment->date ) );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/emails/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function give_email_preview_template_tags( $message ) {
$message = str_replace( '{name}', $user->display_name, $message );
$message = str_replace( '{fullname}', $user->display_name, $message );
$message = str_replace( '{username}', $user->user_login, $message );
$message = str_replace( '{date}', date( get_option( 'date_format' ), current_time( 'timestamp' ) ), $message );
$message = str_replace( '{date}', date( give_date_format(), current_time( 'timestamp' ) ), $message );
$message = str_replace( '{price}', $price, $message );
$message = str_replace( '{donation}', esc_html__( 'Sample Donation Form Title', 'give' ), $message );
$message = str_replace( '{receipt_id}', $receipt_id, $message );
Expand Down
2 changes: 1 addition & 1 deletion includes/payments/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ function give_get_payment_note_html( $note, $payment_id = 0 ) {
$user = esc_html__( 'System', 'give' );
}

$date_format = get_option( 'date_format' ) . ', ' . get_option( 'time_format' );
$date_format = give_date_format() . ', ' . get_option( 'time_format' );

$delete_note_url = wp_nonce_url( add_query_arg( array(
'give-action' => 'delete_payment_note',
Expand Down
2 changes: 1 addition & 1 deletion templates/history-donations.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
do_action( 'give_purchase_history_row_start', $post->ID, $donation_data );
?>
<td class="give_purchase_id">#<?php echo give_get_payment_number( $post->ID ); ?></td>
<td class="give_purchase_date"><?php echo date_i18n( get_option( 'date_format' ), strtotime( get_post_field( 'post_date', $post->ID ) ) ); ?></td>
<td class="give_purchase_date"><?php echo date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) ); ?></td>
<td class="give_purchase_amount">
<span class="give_purchase_amount"><?php echo give_currency_filter( give_format_amount( give_get_payment_amount( $post->ID ) ) ); ?></span>
</td>
Expand Down
2 changes: 1 addition & 1 deletion templates/shortcode-receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<?php if ( filter_var( $give_receipt_args['date'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
<tr>
<td scope="row"><strong><?php esc_html_e( 'Date:', 'give' ); ?></strong></td>
<td><?php echo date_i18n( get_option( 'date_format' ), strtotime( $meta['date'] ) ); ?></td>
<td><?php echo date_i18n( give_date_format(), strtotime( $meta['date'] ) ); ?></td>
</tr>
<?php endif; ?>

Expand Down

0 comments on commit a8bcd70

Please sign in to comment.