Skip to content

Commit

Permalink
fix 'link is expired' because of missing nonce on button to dismiss a…
Browse files Browse the repository at this point in the history
…pi key notice
  • Loading branch information
dannyvankooten committed Nov 19, 2024
1 parent b00400d commit f87722c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes/admin/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,11 @@ public function show_api_key_notice()

echo '<div class="notice notice-warning mc4wp-is-dismissible">';
echo '<p>', sprintf(wp_kses(__('To get started with Mailchimp for WordPress, please <a href="%s">enter your Mailchimp API key on the settings page of the plugin</a>.', 'mailchimp-for-wp'), array( 'a' => array( 'href' => array() ) )), admin_url('admin.php?page=mailchimp-for-wp')), '</p>';
echo '<form method="post"><input type="hidden" name="_mc4wp_action" value="dismiss_api_key_notice" /><button type="submit" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></form>';
echo '<form method="post">';
wp_nonce_field('_mc4wp_action', '_wpnonce');
echo '<input type="hidden" name="_mc4wp_action" value="dismiss_api_key_notice" />';
echo '<button type="submit" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>';
echo '</form>';
echo '</div>';
}

Expand Down

0 comments on commit f87722c

Please sign in to comment.