Skip to content

Commit

Permalink
Use pronamic/wp-html library to workaround escaping issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Oct 4, 2023
1 parent 04f146a commit 64bf89b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions views/meta-box-subscription-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @package Pronamic\WordPress\Pay
*/

use Pronamic\WordPress\Html\Element;
use Pronamic\WordPress\Pay\Plugin;
use Pronamic\WordPress\Pay\Subscriptions\SubscriptionPostType;
use Pronamic\WordPress\Pay\Subscriptions\SubscriptionStatus;
Expand Down Expand Up @@ -142,19 +143,19 @@

<?php

$atts = [
'id' => 'pronamic-pay-next-payment-date',
'name' => 'pronamic_subscription_next_payment_date',
'type' => 'date',
'value' => null === $next_payment_date ? '' : $next_payment_date->format( 'Y-m-d' ),
'data-min' => ( new DateTimeImmutable( 'tomorrow' ) )->format( 'Y-m-d' ),
];

\printf(
'<input %s>',
Util::array_to_html_attributes( $atts )
$element = new Element(
'input',
[
'id' => 'pronamic-pay-next-payment-date',
'name' => 'pronamic_subscription_next_payment_date',
'type' => 'date',
'value' => null === $next_payment_date ? '' : $next_payment_date->format( 'Y-m-d' ),
'data-min' => ( new DateTimeImmutable( 'tomorrow' ) )->format( 'Y-m-d' ),
]
);

$element->output();

?>

<a href="#pronamic-pay-next-payment-date" class="save-pronamic-pay-next-payment-date hide-if-no-js button"><?php esc_html_e( 'OK', 'pronamic_ideal' ); ?></a>
Expand Down

0 comments on commit 64bf89b

Please sign in to comment.