From 52acb07165c183edf3dcf09ede9e9a50c8c515cb Mon Sep 17 00:00:00 2001 From: Frank Fiebig Date: Tue, 7 Feb 2017 17:48:15 +0100 Subject: [PATCH] adjust image sizes --- faf-optim.php | 227 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 136 insertions(+), 91 deletions(-) diff --git a/faf-optim.php b/faf-optim.php index 8c745e4..9404af7 100644 --- a/faf-optim.php +++ b/faf-optim.php @@ -20,6 +20,11 @@ add_action('admin_init', 'registerOptions'); } +function getSizes() +{ + return get_intermediate_image_sizes(); +} + /** * */ @@ -36,9 +41,11 @@ function registerOptions() register_setting('faf-optim', 'keepexif'); register_setting('faf-optim', 'autoopt'); register_setting('faf-optim', 'quality'); - register_setting('faf-optim', 'thumbnail'); - register_setting('faf-optim', 'medium'); - register_setting('faf-optim', 'large'); + + $sizes = getSizes(); + foreach ($sizes AS $size) { + register_setting('faf-optim', $size); + } } /** @@ -61,60 +68,74 @@ function optionsPage() } ?> + + + + + +
+ +

Einstellungen:

+
+ +
+
Exif Daten behalten (kann nicht wieder hergestellt werden)
+
checked>
+ +
Autooptimierung (bei Mediaupload)
+
checked>
+ +
Qualität (JPGs)
+
+ + +
optimieren
+
checked>
+ +
+ + +
+ +
+ + 'attachment', + 'post_mime_type' => 'image', + 'post_status' => 'inherit', + 'posts_per_page' => -1, + ); + $images = new WP_Query($args); + + foreach ($images->posts as $image) { + $ids[] = $image->ID; + } + ?> + +

posts); ?> Bilder in der Mediathek.

+ + +

+ +

+ +
-

Einstellungen:

-
- -
-
Exif Daten behalten (kann nicht wieder hergestellt werden)
-
checked>
- -
Autooptimierung (bei Mediaupload)
-
checked>
- -
Qualität (JPGs)
-
- -
Thumbnail optimieren
-
checked>
- -
Medium optimieren
-
checked>
- -
Large optimieren
-
checked>
-
- - -
- - 'attachment', - 'post_mime_type' => 'image', - 'post_status' => 'inherit', - 'posts_per_page' => -1, - ); - $images = new WP_Query($args); - - foreach ($images->posts as $image) { - $ids[] = $image->ID; - } - ?> - -

posts); ?> Bilder in der Mediathek.

-

- - -