Example #1
0
 public static function init()
 {
     add_action('admin_head', '\\AddBySearch\\AddBySearch::init');
     add_action('admin_footer', '\\AddBySearch\\AddBySearch::loadClientSide');
     add_filter('parse_query', function ($query) {
         $front_end_loader = new FrontendLoader('addons/addbysearch', dirname(__FILE__));
         $front_end_loader->fileServe($query);
         return $query;
     });
     return true;
 }
Example #2
0
 public static function init()
 {
     add_action('admin_head', '\\JasandPereza\\AddMany::init');
     add_action('wp_ajax_AJAXSubmit', '\\JasandPereza\\AddMany::AJAXSubmit');
     add_action('save_post', '\\JasandPereza\\AddMany::saveAll');
     add_filter('parse_query', function ($query) {
         $front_end_loader = new FrontendLoader(dirname(__FILE__), 'addons/addmany', 'Frontend');
         $front_end_loader->fileServe($query);
         return $query;
     });
     return true;
 }
            for ($i = 0; $i < 10; $i++) {
                imagefilter($img, IMG_FILTER_GAUSSIAN_BLUR);
            }
        }
        imagepng($img, $file_path_to_get, $qualities_png[$quality_to_get]);
        imagedestroy($img);
    }
    if ($extension == 'gif') {
        $img = imagecreatefromgif($full_path);
        if ($quality_to_get === 'low') {
            for ($i = 0; $i < 10; $i++) {
                imagefilter($img, IMG_FILTER_GAUSSIAN_BLUR);
            }
        }
        imagegif($img, $file_path_to_get);
        // since you cannot lower a gifs quality, we should use some other effect
        imagedestroy($img);
    }
    $content_type = \FrontendLoader\FrontendLoader::getContentType($file_path_to_get);
    header('Content-type: ' . $content_type);
    header('Content-Length: ' . filesize($file_path_to_get));
    http_response_code(200);
    readfile($file_path_to_get);
    exit;
}
$content_type = \FrontendLoader\FrontendLoader::getContentType($file_path_to_get);
header('Content-type: ' . $content_type);
header('Content-Length: ' . filesize($file_path_to_get));
http_response_code(200);
readfile($file_path_to_get);
exit;