| @@ -71,10 +71,11 @@ | ||
| 71 | 71 | */ |
| 72 | 72 | public function display_settings_form() { |
| 73 | 73 | $gallery_settings = get_option( 'ayg_gallery_settings' ); |
| 74 | 74 | |
| 75 | - $active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->tabs ) ? sanitize_text_field( $_GET['tab'] ) : 'general'; | |
| 76 | - $active_theme = $gallery_settings['theme']; | |
| 75 | + $active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->tabs ) ? sanitize_text_field( $_GET['tab'] ) : 'general'; | |
| 76 | + $active_theme = $gallery_settings['theme']; | |
| 77 | + $pagination_type = $gallery_settings['pagination_type']; | |
| 77 | 78 | |
| 78 | 79 | require_once AYG_DIR . 'admin/templates/settings.php'; |
| 79 | 80 | } |
| 80 | 81 | |
| @@ -174,9 +175,9 @@ | ||
| 174 | 175 | ), |
| 175 | 176 | array( |
| 176 | 177 | 'name' => 'development_mode', |
| 177 | 178 | 'label' => __( 'Development Mode', 'automatic-youtube-gallery' ), |
| 178 | - 'description' => __( 'Do not cache API results when checked. We strongly recommend disabling this option when your site is live.', 'automatic-youtube-gallery' ), | |
| 179 | + 'description' => __( 'Does not cache API results when checked. We strongly recommend disabling this option when your site is live.', 'automatic-youtube-gallery' ), | |
| 179 | 180 | 'type' => 'checkbox', |
| 180 | 181 | 'sanitize_callback' => 'intval' |
| 181 | 182 | ), |
| 182 | 183 | ), |
| @@ -190,9 +191,9 @@ | ||
| 190 | 191 | 'type' => 'wysiwyg', |
| 191 | 192 | 'sanitize_callback' => 'wp_kses_post' |
| 192 | 193 | ) |
| 193 | 194 | ), |
| 194 | - 'ayg_privacy_settings' => array( | |
| 195 | + 'ayg_privacy_settings' => array( | |
| 195 | 196 | array( |
| 196 | 197 | 'name' => 'cookie_consent', |
| 197 | 198 | 'label' => __( 'Cookie Consent', 'automatic-youtube-gallery' ), |
| 198 | 199 | 'description' => __( 'Ask for viewer consent to store YouTube cookies before showing videos.', 'automatic-youtube-gallery' ), |
| @@ -643,9 +644,12 @@ | ||
| 643 | 644 | */ |
| 644 | 645 | public function ajax_callback_delete_cache() { |
| 645 | 646 | check_ajax_referer( 'ayg_ajax_nonce', 'security' ); |
| 646 | 647 | |
| 647 | - ayg_delete_cache(); | |
| 648 | + if ( current_user_can( 'manage_options' ) ) { | |
| 649 | + ayg_delete_cache(); | |
| 650 | + } | |
| 651 | + | |
| 648 | 652 | wp_die(); |
| 649 | 653 | } |
| 650 | 654 | |
| 651 | 655 | } |