Skip to content

Commit 619cee9

Browse files
author
Jippe Holwerda
committed
Show info if key has been configured in wp-config.php.
1 parent 9fd4de9 commit 619cee9

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/class-tiny-settings.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ public function render_api_key() {
151151
if (is_multisite() && !empty($multisite_key)) {
152152
echo '<p>' . self::translate('The API key has been installed by the Network Admin') . '.</p>';
153153
} else {
154-
echo '<input type="text" id="' . $field . '" name="' . $field . '" value="' . htmlspecialchars($key) . '" size="40" />';
154+
if (defined('TINY_API_KEY')) {
155+
echo '<p>' . self::translate('The API key has been configured in wp-config.php') . '.</p>';
156+
} else {
157+
echo '<input type="text" id="' . $field . '" name="' . $field . '" value="' . htmlspecialchars($key) . '" size="40" />';
158+
}
155159
if (empty($key)) {
156160
echo '<p>';
157161
$link = '<a href="https://tinypng.com/developers">' . self::translate_escape('TinyPNG Developer section') . '</a>';

src/languages/tiny-compress-images-nl_NL.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,6 @@ msgstr "Je netwerkbeheerder kan de sleutel wijzigen"
105105

106106
msgid "The API key has been installed by the Network Admin"
107107
msgstr "De API-sleutel is geïnstalleerd door de netwerkbeheerder"
108+
109+
msgid "The API key has been configured in wp-config.php"
110+
msgstr "De API-sleutel is geconfigureerd in wp-config.php"

0 commit comments

Comments
 (0)