Skip to content

Commit 3f0cc81

Browse files
author
Edwin Westerhoud
committed
Include hidden field with API key in status check to prevent it from disappearing when saving settings before the check completed.
1 parent fa7886a commit 3f0cc81

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/views/account-status-loading.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
'Retrieving account status',
55
'tiny-compress-images'
66
); ?></p>
7+
8+
<input type="hidden" id="<?php echo esc_attr( self::get_prefixed_name( 'api_key' ) ); ?>"
9+
name="<?php echo esc_attr( self::get_prefixed_name( 'api_key' ) ); ?>" size="35" spellcheck="false"
10+
value="<?php echo esc_attr( $key ); ?>">
711
</div>
812
</div>

src/views/account-status-update.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
), $link );
1616
?></p>
1717

18-
<input type="text" id="tinypng_api_key"
19-
name="tinypng_api_key" size="35" spellcheck="false"
18+
<input type="text" id="<?php echo esc_attr( self::get_prefixed_name( 'api_key' ) ); ?>"
19+
name="<?php echo esc_attr( self::get_prefixed_name( 'api_key' ) ); ?>" size="35" spellcheck="false"
2020
value="<?php echo esc_attr( $key ); ?>">
2121

2222
<button class="button button-primary" data-tiny-action="update-key"><?php

0 commit comments

Comments
 (0)