api-keys.php
76 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Hustle Turnstile API Keys Settings Template. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 7.8.13 |
| 7 | */ |
| 8 | |
| 9 | ?> |
| 10 | <div class="sui-form-field"> |
| 11 | |
| 12 | <label for="hustle-turnstile-api-key" id="hustle-turnstile-api-key-label" class="sui-label"> |
| 13 | <?php esc_html_e( 'API Key (Site Key)', 'hustle' ); ?> |
| 14 | </label> |
| 15 | |
| 16 | <input |
| 17 | type="text" |
| 18 | name="turnstile_api_key" |
| 19 | value="<?php echo esc_attr( $settings['turnstile_api_key'] ); ?>" |
| 20 | placeholder="<?php esc_html_e( 'Enter your Turnstile site key here', 'hustle' ); ?>" |
| 21 | id="hustle-turnstile-api-key" |
| 22 | class="sui-form-control" |
| 23 | aria-labelledby="hustle-turnstile-api-key-label" |
| 24 | /> |
| 25 | <span class="sui-description"><?php esc_html_e( 'The site key is used to render the Turnstile widget on your opt-in forms. You can find it in your Cloudflare Turnstile dashboard.', 'hustle' ); ?></span> |
| 26 | |
| 27 | </div> |
| 28 | |
| 29 | <div class="sui-form-field"> |
| 30 | |
| 31 | <label for="hustle-turnstile-client-secret" id="hustle-turnstile-client-secret-label" class="sui-label"> |
| 32 | <?php esc_html_e( 'Client Secret Key', 'hustle' ); ?> |
| 33 | </label> |
| 34 | |
| 35 | <input |
| 36 | type="password" |
| 37 | name="turnstile_client_secret" |
| 38 | value="<?php echo esc_attr( $settings['turnstile_client_secret'] ); ?>" |
| 39 | placeholder="<?php esc_html_e( 'Enter your Turnstile secret key here', 'hustle' ); ?>" |
| 40 | id="hustle-turnstile-client-secret" |
| 41 | class="sui-form-control" |
| 42 | aria-labelledby="hustle-turnstile-client-secret-label" |
| 43 | /> |
| 44 | <span class="sui-description"><?php esc_html_e( 'The secret key is used for server-side verification. Keep it private and never expose it publicly.', 'hustle' ); ?></span> |
| 45 | |
| 46 | </div> |
| 47 | <div class="sui-form-field" data-id="checkbox" data-render-id="0"> |
| 48 | |
| 49 | <label class="sui-label"><?php esc_html_e( 'Turnstile Captcha Preview', 'hustle' ); ?></label> |
| 50 | |
| 51 | <div |
| 52 | id="hustle-modal-turnstile-captcha-0" |
| 53 | class="hustle-turnstile-preview-container hustle-turnstile" |
| 54 | style="display: none;" |
| 55 | data-sitekey="" |
| 56 | data-theme="light" |
| 57 | data-size="normal" |
| 58 | data-language="<?php echo isset( $settings['language'] ) ? esc_attr( $settings['language'] ) : 'auto'; ?>" |
| 59 | ></div> |
| 60 | |
| 61 | <?php |
| 62 | $this->get_html_for_options( |
| 63 | array( |
| 64 | array( |
| 65 | 'type' => 'inline_notice', |
| 66 | 'class' => 'hustle-turnstile-captcha-0-preview-notice', |
| 67 | 'icon' => 'info', |
| 68 | 'value' => esc_html__( 'Save your API keys to load the Turnstile preview.', 'hustle' ), |
| 69 | 'attributes' => array( |
| 70 | 'style' => 'margin-top: 0;', |
| 71 | ), |
| 72 | ), |
| 73 | ) |
| 74 | ); |
| 75 | ?> |
| 76 | </div> |