| @@ -46,13 +46,14 @@ | ||
| 46 | 46 | * Conditionally renders Form Preview markup |
| 47 | 47 | * |
| 48 | 48 | * If the current page query matches the form preview's slug, method renders the form preview. |
| 49 | 49 | * |
| 50 | + * @since 4.16.6 add user capability check | |
| 50 | 51 | * @since 2.8.0 |
| 51 | 52 | **/ |
| 52 | 53 | public function setup_form_preview() |
| 53 | 54 | { |
| 54 | - if (empty($_GET['page']) || $this->slug !== $_GET['page']) { // WPCS: CSRF ok, input var ok. | |
| 55 | + if (empty($_GET['page']) || $this->slug !== $_GET['page'] || ! current_user_can('manage_give_settings')) { // WPCS: CSRF ok, input var ok. | |
| 55 | 56 | return; |
| 56 | 57 | } else { |
| 57 | 58 | $this->render_page(); |
| 58 | 59 | } |