wordpress/wp-content/plugins/kt-tinymce-color-grid/index.php
/**
         * Sanitize and saves settings
         * @since 1.7
         */
Sanitize and saves settings
@since 1.7
Sanitize and saves settings @since 1 . 7
protected function save_settings() {
            if (!wp_verify_nonce($this->get_request('kt_settings_nonce'), self::NONCE)) {
                return;
            }
            $action = $this->get_request('kt_action', $this->get_request('kt_hidden_action'));
            $type = $this->get_request('kt_type');
            if (!in_array($type, $this->types)) {
                $type = self::DEFAULT_TYPE;
            }
            $visual = $type == 'palette' || $this->get_request('kt_visual') ? '1' : false;
            $booleans = array(
                'kt_customizer' => self::CUSTOMIZER,
                'kt_elementor' => self::ELEMENTOR,
                'kt_oxygen_vsb' => self::OXYGEN_VSB,
                'kt_css_vars' => self::CSS_VARS,
                'kt_css_admin_vars' => self::CSS_ADMIN_VARS,
                'kt_acf' => self::ACF,
                'kt_astra' => self::ASTRA_THEME,
                'kt_astra_alpha' => self::ASTRA_ALPHA,
                'kt_suki_theme' => self::SUKI_THEME,
                'kt_fontpress' => self::FONTPRESS,
                'kt_megamaxmenu' => self::MEGAMAXMENU,
                'kt_generatepress' => self::GENERATEPRESS,
                'kt_generatepress_alpha' => self::GENERATEPRESS_ALPHA,
                'kt_oceanwp' => self::OCEANWP,
                'kt_oceanwp_alpha' => self::OCEANWP_ALPHA,
                'kt_beaverbuilder' => self::BEAVERBUILDER,
                'kt_gutenberg' => self::GUTENBERG,
                'kt_gutenberg_merge' => self::GUTENBERG_MERGE,
                'kt_gutenberg_force' => self::GUTENBERG_FORCE,
            );
            foreach ($booleans as $field => $option) {
                $this->set_option($option, $this->get_request($field) ? '1' : false);
            }
            $palette_saved = $this->save_palette();
            if (!$palette_saved && $type == 'palette') {
                $type = 'default';
                $visual = '';
            }
            $this->set_option(self::TYPE, $type);
            $this->set_option(self::VISUAL, $visual);
            $lumas = array('linear') + $this->get_luma_transformations('ids');
            $this->set('kt_rows', $this->rows, self::ROWS, self::DEFAULT_ROWS);
            $this->set('kt_cols', $this->columns, self::COLS, self::DEFAULT_COLS);
            $this->set('kt_luma', $lumas, self::LUMA, self::DEFAULT_LUMA);
            $this->set('kt_blocks', $this->blocks, self::BLOCKS, self::DEFAULT_BLOCKS);
            $this->set('kt_block_size', $this->sizes, self::SIZE, self::DEFAULT_SIZE);
            $this->set('kt_axis', $this->axes, self::AXIS, self::DEFAULT_AXIS);
            $this->set('kt_spread', $this->spread, self::SPREAD, self::DEFAULT_SPREAD);
            $this->set('kt_clamp', $this->clamp, self::CLAMP, self::DEFAULT_CLAMP);
            $clamps = intval($this->get_request('kt_clamps'));
            if ($clamps < 4 || $clamps > 18) {
                $clamps = self::DEFAULT_CLAMPS;
            }
            $this->set_option(self::CLAMPS, $clamps);
            list($error, $action) = $this->handle_backup($action);
            if (!$error || $error == 'ok') {
                $this->render_map();
            }
            if ($error) {
                $url = add_query_arg("kt-{$action}-error", $error);
                wp_redirect($url);
                exit;
            }
            wp_redirect(add_query_arg('updated', $action == 'save' ? '1' : false));
            exit;
        }
protected function save_settings ( ) { if ( ! wp_verify_nonce ( $ this -> get_request ( 'kt_settings_nonce' ) , self :: NONCE ) ) { return ; } $ action = $ this -> get_request ( 'kt_action' , $ this -> get_request ( 'kt_hidden_action' ) ) ; $ type = $ this -> get_request ( 'kt_type' ) ; if ( ! in_array ( $ type , $ this -> types ) ) { $ type = self :: DEFAULT_TYPE ; } $ visual = $ type == 'palette' || $ this -> get_request ( 'kt_visual' ) ? '1' : false ; $ booleans = array ( 'kt_customizer' => self :: CUSTOMIZER , 'kt_elementor' => self :: ELEMENTOR , 'kt_oxygen_vsb' => self :: OXYGEN_VSB , 'kt_css_vars' => self :: CSS_VARS , 'kt_css_admin_vars' => self :: CSS_ADMIN_VARS , 'kt_acf' => self :: ACF , 'kt_astra' => self :: ASTRA_THEME , 'kt_astra_alpha' => self :: ASTRA_ALPHA , 'kt_suki_theme' => self :: SUKI_THEME , 'kt_fontpress' => self :: FONTPRESS , 'kt_megamaxmenu' => self :: MEGAMAXMENU , 'kt_generatepress' => self :: GENERATEPRESS , 'kt_generatepress_alpha' => self :: GENERATEPRESS_ALPHA , 'kt_oceanwp' => self :: OCEANWP , 'kt_oceanwp_alpha' => self :: OCEANWP_ALPHA , 'kt_beaverbuilder' => self :: BEAVERBUILDER , 'kt_gutenberg' => self :: GUTENBERG , 'kt_gutenberg_merge' => self :: GUTENBERG_MERGE , 'kt_gutenberg_force' => self :: GUTENBERG_FORCE , ) ; foreach ( $ booleans as $ field => $ option ) { $ this -> set_option ( $ option , $ this -> get_request ( $ field ) ? '1' : false ) ; } $ palette_saved = $ this -> save_palette ( ) ; if ( ! $ palette_saved && $ type == 'palette' ) { $ type = 'default' ; $ visual = '' ; } $ this -> set_option ( self :: TYPE , $ type ) ; $ this -> set_option ( self :: VISUAL , $ visual ) ; $ lumas = array ( 'linear' ) + $ this -> get_luma_transformations ( 'ids' ) ; $ this -> set ( 'kt_rows' , $ this -> rows , self :: ROWS , self :: DEFAULT_ROWS ) ; $ this -> set ( 'kt_cols' , $ this -> columns , self :: COLS , self :: DEFAULT_COLS ) ; $ this -> set ( 'kt_luma' , $ lumas , self :: LUMA , self :: DEFAULT_LUMA ) ; $ this -> set ( 'kt_blocks' , $ this -> blocks , self :: BLOCKS , self :: DEFAULT_BLOCKS ) ; $ this -> set ( 'kt_block_size' , $ this -> sizes , self :: SIZE , self :: DEFAULT_SIZE ) ; $ this -> set ( 'kt_axis' , $ this -> axes , self :: AXIS , self :: DEFAULT_AXIS ) ; $ this -> set ( 'kt_spread' , $ this -> spread , self :: SPREAD , self :: DEFAULT_SPREAD ) ; $ this -> set ( 'kt_clamp' , $ this -> clamp , self :: CLAMP , self :: DEFAULT_CLAMP ) ; $ clamps = intval ( $ this -> get_request ( 'kt_clamps' ) ) ; if ( $ clamps < 4 || $ clamps > 18 ) { $ clamps = self :: DEFAULT_CLAMPS ; } $ this -> set_option ( self :: CLAMPS , $ clamps ) ; list ( $ error , $ action ) = $ this -> handle_backup ( $ action ) ; if ( ! $ error || $ error == 'ok' ) { $ this -> render_map ( ) ; } if ( $ error ) { $ url = add_query_arg ( " kt- { $ action } -error " , $ error ) ; wp_redirect ( $ url ) ; exit ; } wp_redirect ( add_query_arg ( 'updated' , $ action == 'save' ? '1' : false ) ) ; exit ; }
Sanitize and saves settings
 @since 1.7
Sanitize and saves settings @since 1 . 7