Skip to content

Commit b80e491

Browse files
authored
Feature Showcase new card versions
Change new cards in Feature Showcase to use a manually defined version instead of using the current version number. (#819)
1 parent 936cde2 commit b80e491

2 files changed

+5
-3
lines changed

FeatureShowcase_Plugin_Admin.php

+3
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ private static function get_cards() {
254254
'">' . __( 'More info', 'w3-total-cache' ) . '<span class="dashicons dashicons-external"></span></a>',
255255
'is_premium' => true,
256256
'is_new' => true,
257+
'version' => '2.7.0',
257258
),
258259
'preload-requests' => array(
259260
'title' => esc_html__( 'Preload Requests', 'w3-total-cache' ),
@@ -269,6 +270,7 @@ private static function get_cards() {
269270
'">' . __( 'More info', 'w3-total-cache' ) . '<span class="dashicons dashicons-external"></span></a>',
270271
'is_premium' => true,
271272
'is_new' => true,
273+
'version' => '2.6.1',
272274
),
273275
'defer-scripts' => array(
274276
'title' => esc_html__( 'Delay Scripts', 'w3-total-cache' ),
@@ -284,6 +286,7 @@ private static function get_cards() {
284286
'">' . __( 'More info', 'w3-total-cache' ) . '<span class="dashicons dashicons-external"></span></a>',
285287
'is_premium' => true,
286288
'is_new' => true,
289+
'version' => '2.6.1',
287290
),
288291
),
289292
'old' => array(

FeatureShowcase_Plugin_Admin_View.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
$card_classes = 'w3tc-card';
4545
$title_classes = 'w3tc-card-title';
4646
$is_premium = ! empty( $card['is_premium'] );
47-
$is_new = ! empty( $card['is_new'] );
4847

4948
if ( $is_premium ) {
5049
$card_classes .= ' w3tc-card-premium';
@@ -80,13 +79,13 @@
8079
</div><div class="w3tc-card-links"><?php echo $card['link']; ?></div>
8180
</div>
8281
<?php
83-
if ( $is_new ) {
82+
if ( ! empty( $card['is_new'] ) && ! empty( $card['version'] ) ) {
8483
?>
8584
<div class="w3tc-card-ribbon-new">
8685
<span class="dashicons dashicons-awards"></span>
8786
<b><?php esc_html_e( 'New', 'w3-total-cache' ); ?></b>
8887
<span>
89-
<?php esc_html_e( 'in', 'w3-total-cache' ); ?> W3 Total Cache Pro <?php echo W3TC_VERSION; ?>!
88+
<?php esc_html_e( 'in', 'w3-total-cache' ); ?> W3 Total Cache <?php echo $card['version']; ?> !
9089
</span>
9190
</div>
9291
<?php

0 commit comments

Comments
 (0)