Exemple #1
0
 /**
  *
  * Replace default image size based in settings->media
  *
  * @param array $image_sizes array with all image size
  *
  * @access private
  * @return void
  */
 private function defaultImageSize(array $image_sizes)
 {
     foreach ($image_sizes as $name => $defualt) {
         Option::update_option($name . '_size_w', $defualt['width']);
         Option::update_option($name . '_size_h', $defualt['height']);
         $crop = $defualt['crop'] ? 1 : 0;
         if ('post-thumbnail' == $name) {
             //add icon image
             \set_post_thumbnail_size($defualt['width'], $defualt['height'], $crop);
         }
         if (false === Option::get_option($name . '_crop')) {
             Option::add_option($name . '_crop', $crop);
         } else {
             Option::update_option($name . '_crop', $crop);
         }
     }
 }