Skip to content

Commit 4e370a4

Browse files
committed
Added support for dynamic price suffix in $addon data.
1 parent d0eeea2 commit 4e370a4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

includes/admin/views/html-admin-page-addons.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,14 @@ class="<?php echo $current_section === $section->slug ? 'current' : ''; ?>"
194194
<?php if ( '&#36;0.00' === $addon->price ) : ?>
195195
<span class="price"><?php esc_html_e( 'Free', 'woocommerce' ); ?></span>
196196
<?php else : ?>
197+
<?php
198+
$price_suffix = __( 'per year', 'woocommerce' );
199+
if ( $addon->price_suffix ) {
200+
$price_suffix = $addon->price_suffix;
201+
}
202+
?>
197203
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
198-
<span class="price-suffix"><?php esc_html_e( 'per year', 'woocommerce' ); ?></span>
204+
<span class="price-suffix"><?php echo esc_html( $price_suffix ); ?></span>
199205
<?php endif; ?>
200206
</div>
201207
<?php if ( ! empty( $addon->reviews_count ) && ! empty( $addon->rating ) ) : ?>

0 commit comments

Comments
 (0)