PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 1.4.8
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v1.4.8
3.4.4 3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 All 197 releases
← All changes | admin/section/class-convertkit-settings-general.php +86 -449 2.2.5 → 1.4.8 View file →
@@ -1,7 +1,7 @@
1 1 <?php
2 2 /**
3 - * ConvertKit Settings General class.
3 + * ConvertKit General Settings class
4 4 *
5 5 * @package ConvertKit
6 6 * @author ConvertKit
7 7 */
@@ -6,206 +6,60 @@
6 6 * @author ConvertKit
7 7 */
8 8
9 9 /**
10 - * Registers General Settings that can be edited at Settings > ConvertKit > General.
11 - *
12 - * @package ConvertKit
13 - * @author ConvertKit
10 + * Class ConvertKit_Settings_General
14 11 */
15 12 class ConvertKit_Settings_General extends ConvertKit_Settings_Base {
16 13
17 14 /**
18 - * Holds the API instance.
19 - *
20 - * @since 1.9.6
21 - *
22 - * @var ConvertKit_API
15 + * Constructor
23 16 */
24 - private $api;
25 -
26 - /**
27 - * Holds the ConvertKit Account Name.
28 - *
29 - * @since 1.9.6
30 - *
31 - * @var bool|WP_Error|array
32 - */
33 - private $account = false;
34 -
35 - /**
36 - * Holds the ConvertKit Forms Resource.
37 - *
38 - * @since 1.9.6
39 - *
40 - * @var bool|ConvertKit_Resource_Forms;
41 - */
42 - private $forms = false;
43 -
44 - /**
45 - * Constructor.
46 - */
47 17 public function __construct() {
18 + $this->settings_key = WP_ConvertKit::SETTINGS_PAGE_SLUG;
19 + $this->name = 'general';
20 + $this->title = __( 'General Settings', 'convertkit' );
21 + $this->tab_text = __( 'General', 'convertkit' );
48 22
49 - // Define the class that reads/writes settings.
50 - $this->settings = new ConvertKit_Settings();
51 -
52 - // Define the settings key.
53 - $this->settings_key = $this->settings::SETTINGS_NAME;
54 -
55 - // Define the programmatic name, Title and Tab Text.
56 - $this->name = 'general';
57 - $this->title = __( 'General Settings', 'convertkit' );
58 - $this->tab_text = __( 'General', 'convertkit' );
59 -
60 - // Enqueue scripts and CSS.
61 - add_action( 'convertkit_admin_settings_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
62 - add_action( 'convertkit_admin_settings_enqueue_styles', array( $this, 'enqueue_styles' ) );
63 -
64 - // Render container element.
65 - add_action( 'convertkit_settings_base_render_before', array( $this, 'render_before' ) );
66 -
67 23 parent::__construct();
68 -
69 24 }
70 25
71 26 /**
72 - * Enqueues scripts for the Settings > General screen.
73 - *
74 - * @since 2.2.4
75 - *
76 - * @param string $section Settings section / tab (general|tools|restrict-content).
27 + * Register and add settings
77 28 */
78 - public function enqueue_scripts( $section ) {
79 -
80 - // Bail if we're not on the general section.
81 - if ( $section !== $this->name ) {
82 - return;
83 - }
84 -
85 - // Enqueue Select2 JS.
86 - convertkit_select2_enqueue_scripts();
87 -
88 - // Enqueue Preview Output JS.
89 - wp_enqueue_script( 'convertkit-admin-preview-output', CONVERTKIT_PLUGIN_URL . 'resources/backend/js/preview-output.js', array( 'jquery' ), CONVERTKIT_PLUGIN_VERSION, true );
90 -
91 - }
92 -
93 - /**
94 - * Enqueues styles for the Settings > General screen.
95 - *
96 - * @since 2.2.4
97 - *
98 - * @param string $section Settings section / tab (general|tools|restrict-content).
99 - */
100 - public function enqueue_styles( $section ) {
101 -
102 - // Bail if we're not on the general section.
103 - if ( $section !== $this->name ) {
104 - return;
105 - }
106 -
107 - // Enqueue Select2 CSS.
108 - convertkit_select2_enqueue_styles();
109 -
110 - }
111 -
112 - /**
113 - * Registers settings fields for this section.
114 - */
115 29 public function register_fields() {
116 -
117 30 add_settings_field(
118 - 'account_name',
119 - __( 'Account Name', 'convertkit' ),
120 - array( $this, 'account_name_callback' ),
121 - $this->settings_key,
122 - $this->name
123 - );
124 -
125 - add_settings_field(
126 31 'api_key',
127 - __( 'API Key', 'convertkit' ),
32 + 'API Key',
128 33 array( $this, 'api_key_callback' ),
129 34 $this->settings_key,
130 - $this->name,
131 - array(
132 - 'label_for' => 'api_key',
133 - )
35 + $this->name
134 36 );
135 37
136 38 add_settings_field(
137 39 'api_secret',
138 - __( 'API Secret', 'convertkit' ),
40 + 'API Secret',
139 41 array( $this, 'api_secret_callback' ),
140 42 $this->settings_key,
141 - $this->name,
142 - array(
143 - 'label_for' => 'api_secret',
144 - )
43 + $this->name
145 44 );
146 45
147 - foreach ( convertkit_get_supported_post_types() as $supported_post_type ) {
148 - // Get Post Type's Label.
149 - $post_type = get_post_type_object( $supported_post_type );
150 -
151 - // Skip if the Post Type doesn't exist.
152 - if ( ! $post_type ) {
153 - continue;
154 - }
155 -
156 - // Add Settings Field.
157 - add_settings_field(
158 - $supported_post_type . '_form',
159 - sprintf(
160 - /* translators: Post Type Name */
161 - __( 'Default Form (%s)', 'convertkit' ),
162 - $post_type->label
163 - ),
164 - array( $this, 'custom_post_types_callback' ),
165 - $this->settings_key,
166 - $this->name,
167 - array(
168 - 'label_for' => '_wp_convertkit_settings_' . $supported_post_type . '_form',
169 - 'post_type' => $supported_post_type,
170 - 'post_type_object' => $post_type,
171 - )
172 - );
173 - }
174 -
175 46 add_settings_field(
176 - 'debug',
177 - __( 'Debug', 'convertkit' ),
178 - array( $this, 'debug_callback' ),
47 + 'default_form',
48 + 'Default Form',
49 + array( $this, 'default_form_callback' ),
179 50 $this->settings_key,
180 51 $this->name,
181 - array(
182 - 'label_for' => 'debug',
183 - )
52 + $this->api->get_resources( 'forms' )
184 53 );
185 54
186 55 add_settings_field(
187 - 'no_scripts',
188 - __( 'Disable JavaScript', 'convertkit' ),
189 - array( $this, 'no_scripts_callback' ),
56 + 'debug',
57 + 'Debug',
58 + array( $this, 'debug_callback' ),
190 59 $this->settings_key,
191 - $this->name,
192 - array(
193 - 'label_for' => 'no_scripts',
194 - )
60 + $this->name
195 61 );
196 -
197 - add_settings_field(
198 - 'no_css',
199 - __( 'Disable CSS', 'convertkit' ),
200 - array( $this, 'no_css_callback' ),
201 - $this->settings_key,
202 - $this->name,
203 - array(
204 - 'label_for' => 'no_css',
205 - )
206 - );
207 -
208 62 }
209 63
210 64 /**
211 65 * Prints help info for this section
@@ -210,333 +64,116 @@
210 64 /**
211 65 * Prints help info for this section
212 66 */
213 67 public function print_section_info() {
214 -
215 68 ?>
216 69 <p><?php esc_html_e( 'Choosing a default form will embed it at the bottom of every post or page (in single view only) across your site.', 'convertkit' ); ?></p>
217 - <p><?php esc_html_e( 'If you wish to turn off form embedding or select a different form for an individual post or page, you can do so using the ConvertKit meta box on the edit page.', 'convertkit' ); ?></p>
218 - <p>
219 - <?php
220 - printf(
221 - /* translators: [convertkit] shortcode, wrapped in <code> tags */
222 - esc_html__( 'The default form can be inserted into the middle of post or page content by using the %s shortcode.', 'convertkit' ),
223 - '<code>[convertkit]</code>'
224 - );
225 - ?>
226 - </p>
70 + <p><?php esc_html_e( 'If you wish to turn off form embedding or select a different form for an individual post or page, you can do so using the ConvertKit meta box on the edit page.', 'convertkit' ); ?></p><?php
71 + /* translators: 1: shortcode */ ?>
72 + <p><?php printf( esc_html__( 'The default form can be inserted into the middle of post or page content by using the %s shortcode.', 'convertkit' ), '<code>[convertkit]</code>' ); ?></p>
227 73 <?php
228 -
229 74 }
230 75
231 76 /**
232 - * Returns the URL for the ConvertKit documentation for this setting section.
233 - *
234 - * @since 2.0.8
235 - *
236 - * @return string Documentation URL.
77 + * Renders the input for api key entry
237 78 */
238 - public function documentation_url() {
239 -
240 - return 'https://help.convertkit.com/en/articles/2502591-the-convertkit-wordpress-plugin';
241 -
242 - }
243 -
244 - /**
245 - * Renders container divs for styling, and attempts to fetch the ConvertKit Account
246 - * details if API credentials have been specified.
247 - *
248 - * @since 1.9.6
249 - */
250 - public function render_before() {
251 -
252 - // Initialize the API if an API Key and Secret is defined.
253 - if ( ! $this->settings->has_api_key_and_secret() ) {
254 - return;
255 - }
256 -
257 - $this->api = new ConvertKit_API(
258 - $this->settings->get_api_key(),
259 - $this->settings->get_api_secret(),
260 - $this->settings->debug_enabled(),
261 - 'settings'
79 + public function api_key_callback() {
80 + $html = sprintf(
81 + '<input type="text" class="regular-text code" id="api_key" name="%s[api_key]" value="%s" />',
82 + $this->settings_key,
83 + isset( $this->options['api_key'] ) ? esc_attr( $this->options['api_key'] ) : ''
262 84 );
263 85
264 - // Get Account Details, which we'll use in account_name_callback(), but also lets us test
265 - // whether the API credentials are valid.
266 - $this->account = $this->api->account();
86 + $html .= '<p class="description"><a href="https://app.convertkit.com/account/edit" target="_blank">' . __( 'Get your ConvertKit API Key', 'convertkit' ) . '</a></p>';
267 87
268 - // Show an error message if Account Details could not be fetched e.g. API credentials supplied are invalid.
269 - if ( is_wp_error( $this->account ) ) {
270 - // Depending on the error code, maybe persist a notice in the WordPress Administration until the user
271 - // fixes the problem.
272 - switch ( $this->account->get_error_data( $this->account->get_error_code() ) ) {
273 - case 401:
274 - // API credentials are invalid.
275 - WP_ConvertKit()->get_class( 'admin_notices' )->add( 'authorization_failed' );
276 - break;
277 - }
278 -
279 - $this->output_error( $this->account->get_error_message() );
280 - } else {
281 - // Remove any existing persistent notice.
282 - WP_ConvertKit()->get_class( 'admin_notices' )->delete( 'authorization_failed' );
283 - }
284 -
88 + echo $html; // WPCS: XSS ok.
285 89 }
286 90
287 91 /**
288 - * Outputs the Account Name
289 - *
290 - * @since 1.9.6
92 + * Renders the input for api key entry
291 93 */
292 - public function account_name_callback() {
293 -
294 - // Output a notice telling the user to enter their API Key and Secret if they haven't done so yet.
295 - if ( ! $this->settings->has_api_key_and_secret() || is_wp_error( $this->account ) ) {
296 - echo '<p class="description">' . esc_html__( 'Add a valid API Key and Secret to get started', 'convertkit' ) . '</p>';
297 - return;
298 - }
299 -
300 - // Output Account Name.
301 - $html = sprintf(
302 - '<code>%s</code>',
303 - isset( $this->account['name'] ) ? esc_attr( $this->account['name'] ) : esc_html__( '(Not specified)', 'convertkit' )
94 + public function api_secret_callback() {
95 + $html = sprintf(
96 + '<input type="text" class="regular-text code" id="api_secret" name="%s[api_secret]" value="%s" />',
97 + $this->settings_key,
98 + isset( $this->options['api_secret'] ) ? esc_attr( $this->options['api_secret'] ) : ''
304 99 );
305 - $html .= '<p class="description">' . esc_html__( 'The name of your connected ConvertKit account.', 'convertkit' ) . '</p>';
306 100
307 - // Output has already been run through escaping functions above.
308 - echo $html; // phpcs:ignore WordPress.Security.EscapeOutput
309 - }
101 + $html .= '<p class="description"><a href="https://app.convertkit.com/account/edit" target="_blank">';
102 + $html .= __( 'Get your ConvertKit API Secret.', 'convertkit' ) . '</a>';
103 + $html .= ' ' . __( 'This setting is required to unsubscribe subscribers.', 'convertkit' ) . '</p>';
310 104
311 - /**
312 - * Renders the input for the API Key setting.
313 - *
314 - * @since 1.9.6
315 - */
316 - public function api_key_callback() {
317 -
318 - // If the API Key is stored as a constant, it cannot be edited here.
319 - if ( $this->settings->is_api_key_a_constant() ) {
320 - echo $this->get_masked_value( // phpcs:ignore WordPress.Security.EscapeOutput
321 - $this->settings->get_api_key(),
322 - esc_html__( 'Your API Key has been defined in your wp-config.php file. For security, it is not displayed here.', 'convertkit' )
323 - );
324 - return;
325 - }
326 -
327 - // Output field.
328 - echo $this->get_text_field( // phpcs:ignore WordPress.Security.EscapeOutput
329 - 'api_key',
330 - esc_attr( $this->settings->get_api_key() ),
331 - array(
332 - sprintf(
333 - /* translators: %1$s: Link to ConvertKit Account */
334 - esc_html__( '%1$s Required for proper plugin function.', 'convertkit' ),
335 - '<a href="' . esc_url( convertkit_get_api_key_url() ) . '" target="_blank">' . esc_html__( 'Get your ConvertKit API Key.', 'convertkit' ) . '</a>'
336 - ),
337 - sprintf(
338 - /* translators: Account, %1$s: wp-config.php, %2$s: <code> block for API Key definition */
339 - esc_html__( 'Alternatively specify your API Key in the %1$s file using %2$s', 'convertkit' ),
340 - '<code>wp-config.php</code>',
341 - '<code>define(\'CONVERTKIT_API_KEY\', \'your-api-key\');</code>'
342 - ),
343 - ),
344 - array( 'regular-text', 'code' )
345 - );
346 -
105 + echo $html; // WPCS: XSS ok.
347 106 }
348 107
349 108 /**
350 - * Renders the input for the API Secret setting.
109 + * Renders the form select list
351 110 *
352 - * @since 1.9.6
111 + * @param array $forms Form listing.
353 112 */
354 - public function api_secret_callback() {
113 + public function default_form_callback( $forms ) {
355 114
356 - // If the API Secret is stored as a constant, it cannot be edited here.
357 - if ( $this->settings->is_api_secret_a_constant() ) {
358 - echo $this->get_masked_value( // phpcs:ignore WordPress.Security.EscapeOutput
359 - $this->settings->get_api_secret(),
360 - esc_html__( 'Your API Secret has been defined in your wp-config.php file. For security, it is not displayed here.', 'convertkit' )
361 - );
362 - return;
115 + // Check for error in response.
116 + if ( isset( $forms[0]['id'] ) && '-2' === $forms[0]['id'] ) {
117 + $html = '<p class="error">' . __( 'Error connecting to API. Please verify your site can connect to <code>https://api.convertkit.com</code>','convertkit' ) . '</p>';
118 + } else {
119 + $html = sprintf( '<select id="default_form" name="%s[default_form]">', $this->settings_key );
120 + $html .= '<option value="default">' . __( 'None', 'convertkit' ) . '</option>';
121 + foreach ( $forms as $form ) {
122 + $html .= sprintf(
123 + '<option value="%s" %s>%s</option>',
124 + esc_attr( $form['id'] ),
125 + selected( $this->options['default_form'], $form['id'], false ),
126 + esc_html( $form['name'] )
127 + );
128 + }
129 + $html .= '</select>';
363 130 }
364 131
365 - // Output field.
366 - echo $this->get_text_field( // phpcs:ignore WordPress.Security.EscapeOutput
367 - 'api_secret',
368 - esc_attr( $this->settings->get_api_secret() ),
369 - array(
370 - sprintf(
371 - /* translators: %1$s: Link to ConvertKit Account */
372 - esc_html__( '%1$s Required for proper plugin function.', 'convertkit' ),
373 - '<a href="' . esc_url( convertkit_get_api_key_url() ) . '" target="_blank">' . esc_html__( 'Get your ConvertKit API Secret.', 'convertkit' ) . '</a>'
374 - ),
375 - sprintf(
376 - /* translators: Account, %1$s: wp-config.php, %2$s: <code> block for API Secret definition */
377 - esc_html__( 'Alternatively specify your API Secret in the %1$s file using %2$s', 'convertkit' ),
378 - '<code>wp-config.php</code>',
379 - '<code>define(\'CONVERTKIT_API_SECRET\', \'your-api-secret\');</code>'
380 - ),
381 - ),
382 - array( 'regular-text', 'code' )
383 - );
384 -
385 - }
386 -
387 - /**
388 - * Renders the input for the Default Form setting for the given Post Type.
389 - *
390 - * @since 1.9.6
391 - *
392 - * @param array $args Field arguments.
393 - */
394 - public function custom_post_types_callback( $args ) {
395 -
396 - // Refresh Forms.
397 - if ( ! $this->forms ) {
398 - $this->forms = new ConvertKit_Resource_Forms( 'settings' );
399 - $this->forms->refresh();
400 -
401 - // Also refresh Landing Pages, Tags and Posts. Whilst not displayed in the Plugin Settings, this ensures up to date
402 - // lists are stored for when editing e.g. Pages.
403 - $landing_pages = new ConvertKit_Resource_Landing_Pages( 'settings' );
404 - $landing_pages->refresh();
405 -
406 - $posts = new ConvertKit_Resource_Posts( 'settings' );
407 - $posts->refresh();
408 -
409 - $products = new ConvertKit_Resource_Products( 'settings' );
410 - $products->refresh();
411 -
412 - $tags = new ConvertKit_Resource_Tags( 'settings' );
413 - $tags->refresh();
132 + if ( empty( $this->options['api_key'] ) ) {
133 + $html .= '<p class="description">' . __( 'Enter your API Key above to get your available forms.', 'convertkit' ) . '</p>';
414 134 }
415 135
416 - // Bail if no Forms exist.
417 - if ( ! $this->forms->exist() ) {
418 - esc_html_e( 'No Forms exist in ConvertKit.', 'convertkit' );
419 - echo '<br /><a href="' . esc_url( convertkit_get_new_form_url() ) . '" target="_blank">' . esc_html__( 'Click here to create your first form', 'convertkit' ) . '</a>';
420 - return;
136 + if ( empty( $forms ) ) {
137 + $html .= '<p class="description">' . __( 'There are no forms setup in your account. You can go <a href="https://app.convertkit.com/landing_pages/new" target="_blank">here</a> to create one.', 'convertkit' ) . '</p>';
421 138 }
422 139
423 - // Build array of select options.
424 - $options = array(
425 - 'default' => esc_html__( 'None', 'convertkit' ),
426 - );
427 - foreach ( $this->forms->get() as $form ) {
428 - $options[ esc_attr( $form['id'] ) ] = esc_html( $form['name'] );
429 - }
430 -
431 - // Build description with preview link.
432 - $description = false;
433 - $preview_url = WP_ConvertKit()->get_class( 'preview_output' )->get_preview_form_url( $args['post_type'] );
434 - if ( $preview_url ) {
435 - // Include a preview link in the description.
436 - $description = sprintf(
437 - '%s %s %s',
438 - sprintf(
439 - /* translators: Post Type name, plural */
440 - esc_html__( 'Select a form above to automatically output below all %s.', 'convertkit' ),
441 - $args['post_type_object']->label
442 - ),
443 - '<a href="' . esc_url( $preview_url ) . '" id="convertkit-preview-form-' . esc_attr( $args['post_type'] ) . '" target="_blank">' . esc_html__( 'Click here', 'convertkit' ) . '</a>',
444 - esc_html__( 'to preview how this will display.', 'convertkit' )
445 - );
446 - } else {
447 - // Just output the field's description.
448 - $description = sprintf(
449 - /* translators: Post Type name, plural */
450 - esc_html__( 'Select a form above to automatically output below all %s.', 'convertkit' ),
451 - $args['post_type_object']->label
452 - );
453 - }
454 -
455 - // Build field.
456 - $select_field = $this->get_select_field(
457 - $args['post_type'] . '_form',
458 - $this->settings->get_default_form( $args['post_type'] ),
459 - $options,
460 - $description,
461 - array(
462 - 'convertkit-select2',
463 - 'convertkit-preview-output-link',
464 - ),
465 - array(
466 - 'data-target' => '#convertkit-preview-form-' . esc_attr( $args['post_type'] ),
467 - 'data-link' => esc_attr( $preview_url ) . '&convertkit_form_id=',
468 - )
469 - );
470 -
471 - // Output field.
472 - echo '<div class="convertkit-select2-container">' . $select_field . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput
473 -
140 + echo $html; // WPCS: XSS ok.
474 141 }
475 142
476 143 /**
477 - * Renders the input for the Debug setting.
478 - *
479 - * @since 1.9.6
144 + * Renders the input for debug setting
480 145 */
481 146 public function debug_callback() {
482 147
483 - // Output field.
484 - echo $this->get_checkbox_field( // phpcs:ignore WordPress.Security.EscapeOutput
485 - 'debug',
486 - 'on',
487 - $this->settings->debug_enabled(), // phpcs:ignore WordPress.Security.EscapeOutput
488 - esc_html__( 'Log requests to file and output browser console messages.', 'convertkit' ),
489 - esc_html__( 'You can ignore this unless you\'re working with our support team to resolve an issue. Decheck this option to improve performance.', 'convertkit' )
490 - );
148 + $debug = '';
149 + if ( isset( $this->options['debug'] ) && 'on' === $this->options['debug'] ) {
150 + $debug = 'checked';
151 + }
491 152
492 - }
493 -
494 - /**
495 - * Renders the input for the Disable Javascript setting.
496 - *
497 - * @since 1.9.6
498 - */
499 - public function no_scripts_callback() {
500 -
501 - // Output field.
502 - echo $this->get_checkbox_field( // phpcs:ignore WordPress.Security.EscapeOutput
503 - 'no_scripts',
504 - 'on',
505 - $this->settings->scripts_disabled(), // phpcs:ignore WordPress.Security.EscapeOutput
506 - esc_html__( 'Prevent plugin from loading JavaScript files. This will disable the custom content and tagging features of the plugin. Does not apply to landing pages. Use with caution!', 'convertkit' )
153 + echo sprintf( // WPCS: XSS OK
154 + '<input type="checkbox" class="" id="debug" name="%s[debug]" %s />%s',
155 + $this->settings_key,
156 + $debug,
157 + __( 'Save connection data to a log file.','convertkit' )
507 158 );
508 159
509 160 }
510 161
511 162 /**
512 - * Renders the input for the Disable CSS setting.
163 + * Sanitizes the settings
513 164 *
514 - * @since 1.9.6.9
165 + * @param array $settings The settings fields submitted.
166 + * @return array Sanitized settings.
515 167 */
516 - public function no_css_callback() {
168 + public function sanitize_settings( $settings ) {
517 169
518 - // Output field.
519 - echo $this->get_checkbox_field( // phpcs:ignore WordPress.Security.EscapeOutput
520 - 'no_css',
521 - 'on',
522 - $this->settings->css_disabled(), // phpcs:ignore WordPress.Security.EscapeOutput
523 - esc_html__( 'Prevents loading plugin CSS files. This will disable styling on broadcasts, form trigger buttons, product buttons and member\'s content. Use with caution!', 'convertkit' ),
524 - array(
525 - sprintf(
526 - '%s <a href="%s" target="_blank">%s</a>',
527 - esc_html__( 'To customize forms and their styling, use the', 'convertkit' ),
528 - esc_url( convertkit_get_form_editor_url() ),
529 - esc_html__( 'ConvertKit form editor', 'convertkit' )
530 - ),
531 - sprintf(
532 - '%s <a href="https://wordpress.org/plugins/contact-form-7/" target="_blank">Contact Form 7</a>, <a href="https://wordpress.org/plugins/convertkit-gravity-forms/" target="_blank">Gravity Forms</a> %s <a href="https://wordpress.org/plugins/integrate-convertkit-wpforms/" target="_blank">WPForms</a> %s',
533 - esc_html__( 'For developers who require custom form designs through use of CSS, consider using the', 'convertkit' ),
534 - esc_html__( 'or', 'convertkit' ),
535 - esc_html__( 'integrations.', 'convertkit' )
536 - ),
537 - )
538 - );
539 -
170 + // Clear the api transient.
171 + delete_transient( 'convertkit_get_api_response' );
172 + return shortcode_atts( array(
173 + 'api_key' => '',
174 + 'api_secret' => '',
175 + 'default_form' => 0,
176 + 'debug' => '',
177 + ), $settings );
540 178 }
541 -
542 179 }