applicationType; $textTypes = $aeh_plugin->textType; $imageTypes = $aeh_plugin->imageType; $audioTypes = $aeh_plugin->audioType; $videoTypes = $aeh_plugin->videoType; $all_files_format = array_merge($imageTypes, $audioTypes, $videoTypes, $applicationTypes, $textTypes); foreach ( $all_files_format as $format){ ${'aeh_'.$format} = ''; } if (isset($_POST['aeh_save_settings'])) { $number_of_formats = (int)count($all_files_format); $j = 0; foreach ( $all_files_format as $format){ if (!empty($_POST['aeh_'.$format.'_days'])) { if (is_int((int)$_POST['aeh_'.$format.'_days'])&& ((int)$_POST['aeh_'.$format.'_days']>0)){ ${'aeh_'.$format.'_days'}= esc_sql((int)$_POST['aeh_'.$format.'_days']); } else { $errors .= 'Please enter an positive integer amount for the "Number of Days" in "'.$format.'" file format
'; } } if (isset($_POST['aeh_'.$format])){ $j++ ; } } if($number_of_formats == $j ) { $errors .= 'You must choose at least one file type.
'; $empty_expires_headers_formats = 0; } if (strlen($errors)> 0){ echo '

' . $errors . '

'; } else{ $options = array( 'enable_aeh' => isset($_POST["enable_aeh"])?1:0, 'enable_gzip' => isset($_POST["enable_gzip"])?1:0, 'disable_etags' => isset($_POST["disable_etags"])?1:0, ); foreach ( $all_files_format as $format){ $options['aeh_'.$format] = isset($_POST['aeh_'.$format])?1:0; if (is_int((int)$_POST['aeh_'.$format.'_days'])){ $options['aeh_'.$format.'_days'] = isset($_POST['aeh_'.$format."_days"])?(int)$_POST['aeh_'.$format."_days"]:0; } } update_option('add_expires_headers_options', $options); //store the results in WP options table echo '
'; echo '

Settings Saved

'; echo '
'; //Now let's modify the .htaccess file $write_result = $aeh_plugin->write_to_htaccess(); if ($write_result){ echo '
'; echo '

Your .htaccess file was successfully updated!

'; echo '
'; } else { echo '

Unable to update changes. Make sure your .htaccess file is editable!

'; } } } $aeh_def_days = 30; $add_expires_headers_options = get_option('add_expires_headers_options'); if ($add_expires_headers_options) { $enable_aeh = $add_expires_headers_options['enable_aeh']; $enable_gzip = $add_expires_headers_options['enable_gzip']; $disable_etags = $add_expires_headers_options['disable_etags']; foreach($all_files_format as $format){ ${'aeh_'.$format} = $add_expires_headers_options['aeh_'.$format]; ${'aeh_'.$format.'_days'} = $add_expires_headers_options['aeh_'.$format.'_days']; } } ?>

Get Started

Documentation

or, start upadting options.

More Actions

/> />
/>

"; } ?>
".strtoupper($imageTypes[$i])."
days
"; } ?>
".strtoupper($audioTypes[$i])."
days
"; } ?>
".strtoupper($videoTypes[$i])."
days

"; } ?>
".strtoupper($textTypes[$i])."
days
"; } ?>
".strtoupper($applicationTypes[$i])."
days

Checkout more about us.