Version Description
Download this release
Release Info
Developer | Rahe |
Plugin | Simple Image Sizes |
Version | 2.4.1 |
Comparing to | |
See all releases |
Code changes from version 2.4 to 2.4.1
- inc/class.admin.php +1 -1
- readme.txt +3 -1
- simple_image_sizes.php +2 -2
- templates/admin-js.html +41 -0
- templates/options-media.php +129 -0
inc/class.admin.php
CHANGED
@@ -305,7 +305,7 @@ Class SISAdmin {
|
|
305 |
if( is_file( SIS_DIR.'/templates/options-media.php' ) ) {
|
306 |
include( SIS_DIR.'/templates/options-media.php' );
|
307 |
} else {
|
308 |
-
|
309 |
}
|
310 |
}
|
311 |
|
305 |
if( is_file( SIS_DIR.'/templates/options-media.php' ) ) {
|
306 |
include( SIS_DIR.'/templates/options-media.php' );
|
307 |
} else {
|
308 |
+
esc_html_e( 'Admin option-media template missing' );
|
309 |
}
|
310 |
}
|
311 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.beapi.fr/donate/
|
|
4 |
Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 3.5
|
7 |
-
Stable tag: 2.4
|
8 |
|
9 |
== Description ==
|
10 |
|
@@ -38,6 +38,8 @@ Contribute on https://github.com/Rahe/Simple-image-sizes
|
|
38 |
4. Regenerating image sizes
|
39 |
|
40 |
== Changelog ==
|
|
|
|
|
41 |
* 2.4
|
42 |
* Made for 3.5 and up
|
43 |
* Refactoring PHP/Javascript code
|
4 |
Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 3.5
|
7 |
+
Stable tag: 2.4.1
|
8 |
|
9 |
== Description ==
|
10 |
|
38 |
4. Regenerating image sizes
|
39 |
|
40 |
== Changelog ==
|
41 |
+
* 2.4.1
|
42 |
+
* Remove function not working on admin file
|
43 |
* 2.4
|
44 |
* Made for 3.5 and up
|
45 |
* Refactoring PHP/Javascript code
|
simple_image_sizes.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Simple Image Size
|
4 |
Plugin URI: http://redmine.beapi.fr/projects/show/simple-image-sizes
|
5 |
Description: Add options in media setting page for images sizes
|
6 |
-
Version: 2.4
|
7 |
Author: Rahe
|
8 |
Author URI: http://nicolas-juen.fr
|
9 |
Text Domain: sis
|
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
29 |
|
30 |
define( 'SIS_URL', plugins_url('', __FILE__) );
|
31 |
define( 'SIS_DIR', dirname(__FILE__) );
|
32 |
-
define( 'SIS_VERSION', '2.4' );
|
33 |
define( 'SIS_OPTION', 'custom_image_sizes' );
|
34 |
|
35 |
require_once( SIS_DIR . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'class.admin.php' );
|
3 |
Plugin Name: Simple Image Size
|
4 |
Plugin URI: http://redmine.beapi.fr/projects/show/simple-image-sizes
|
5 |
Description: Add options in media setting page for images sizes
|
6 |
+
Version: 2.4.1
|
7 |
Author: Rahe
|
8 |
Author URI: http://nicolas-juen.fr
|
9 |
Text Domain: sis
|
29 |
|
30 |
define( 'SIS_URL', plugins_url('', __FILE__) );
|
31 |
define( 'SIS_DIR', dirname(__FILE__) );
|
32 |
+
define( 'SIS_VERSION', '2.4.1' );
|
33 |
define( 'SIS_OPTION', 'custom_image_sizes' );
|
34 |
|
35 |
require_once( SIS_DIR . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'class.admin.php' );
|
templates/admin-js.html
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script type="text/html" id="sis-new_size">
|
2 |
+
<tr valign="top" class="new_size_<%= size_id %> new_size">
|
3 |
+
<th scope="row">
|
4 |
+
<input type="text" id="new_size_<%= size_id %>" value="thumbnail-name">
|
5 |
+
</th>
|
6 |
+
<td>
|
7 |
+
<input type="button" id="validate_<%= size_id %>" value="<%= validate %>" class="button-secondary action add_size_name">
|
8 |
+
</td>
|
9 |
+
</tr>
|
10 |
+
</script>
|
11 |
+
<script type="text/html" id="sis-new_size_row">
|
12 |
+
<th scope="row"><%= size %><%= size_name %></th>
|
13 |
+
<td>
|
14 |
+
<input type="hidden" name="image_name" value="<%= size_name %>">
|
15 |
+
<input type="hidden" name="custom_image_sizes[<%= size_name %>][custom]" value="1">
|
16 |
+
<label for="custom_image_sizes[<%= size_name %>][w]" class="sis-label">
|
17 |
+
<%= maximumWidth %>
|
18 |
+
<input type="number" name="custom_image_sizes[<%= size_name %>][w]" value="1" step="1" min="0" id="custom_image_sizes[<%= size_name %>][w]" base_w="0" class="w small-text">
|
19 |
+
</label>
|
20 |
+
<label for="custom_image_sizes[<%= size_name %>][h]" class="sis-label">
|
21 |
+
<%= maximumHeight %>
|
22 |
+
<input type="number" name="custom_image_sizes[<%= size_name %>][h]" value="1" step="1" min="0" id="custom_image_sizes[<%= size_name %>][h]" base_h="0" class="h small-text">
|
23 |
+
</label>
|
24 |
+
<label for="custom_image_sizes[<%= size_name %>][n]" class="sis-label">
|
25 |
+
<%= customName %>
|
26 |
+
<input type="text" name="custom_image_sizes[<%= size_name %>][n]" id="custom_image_sizes[<%= size_name %>][n]" base_n="<%= size_name %>" class="n">
|
27 |
+
</label>
|
28 |
+
<span class="size_options">
|
29 |
+
<input type="checkbox" name="custom_image_sizes[<%= size_name %>][c]" id="custom_image_sizes[<%= size_name %>][c]" base_c="0" value="1" class="c crop">
|
30 |
+
<label for="custom_image_sizes[<%= size_name %>][c]" id="custom_image_sizes[<%= size_name %>][c]" class="c" title="<%= crop %>">
|
31 |
+
<%= crop %>
|
32 |
+
</label>
|
33 |
+
<input type="checkbox" name="custom_image_sizes[<%= size_name %>][s]" id="custom_image_sizes[<%= size_name %>][s]" base_s="0" value="1" class="s show">
|
34 |
+
<label for="custom_image_sizes[<%= size_name %>][s]" id="custom_image_sizes[<%= size_name %>][s]" class="s" title="<%= show %>">
|
35 |
+
<%= show %>
|
36 |
+
</label>
|
37 |
+
</span>
|
38 |
+
<div class="delete_size"><%= deleteImage %></div>
|
39 |
+
<div class="add_size"><%= validateButton %></div>
|
40 |
+
</td>
|
41 |
+
</script>
|
templates/options-media.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Get the sizes
|
3 |
+
global $_wp_additional_image_sizes,$_wp_post_type_features;
|
4 |
+
?>
|
5 |
+
<input type="hidden" class="addSize" value='<?php echo wp_create_nonce( 'add_size' ); ?>' />
|
6 |
+
<input type="hidden" class="regen" value='<?php echo wp_create_nonce( 'regen' ); ?>' />
|
7 |
+
<input type="hidden" class="getList" value='<?php echo wp_create_nonce( 'getList' ); ?>' />
|
8 |
+
<div id="sis-regen">
|
9 |
+
<div class="wrapper" style="">
|
10 |
+
<h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'sis'); ?> </h4>
|
11 |
+
<table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
|
12 |
+
<thead>
|
13 |
+
<tr>
|
14 |
+
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
|
15 |
+
<th class="manage-column" scope="col"><?php _e( 'Size name', 'sis'); ?></th>
|
16 |
+
<th class="manage-column" scope="col"><?php _e( 'Width', 'sis'); ?></th>
|
17 |
+
<th class="manage-column" scope="col"><?php _e( 'Height', 'sis'); ?></th>
|
18 |
+
<th class="manage-column" scope="col"><?php _e( 'Crop ?', 'sis'); ?></th>
|
19 |
+
</tr>
|
20 |
+
</thead>
|
21 |
+
<tbody>
|
22 |
+
<?php
|
23 |
+
// Display the sizes in the array
|
24 |
+
foreach ( get_intermediate_image_sizes() as $s ):
|
25 |
+
// Don't make or numeric sizes that appear
|
26 |
+
if( is_integer( $s ) ) {
|
27 |
+
continue;
|
28 |
+
}
|
29 |
+
|
30 |
+
// Set width
|
31 |
+
$width = isset( $_wp_additional_image_sizes[$s]['width'] ) ? intval( $_wp_additional_image_sizes[$s]['width'] ) : get_option( "{$s}_size_w" ) ;
|
32 |
+
|
33 |
+
// Set height
|
34 |
+
$height = isset( $_wp_additional_image_sizes[$s]['height'] ) ? intval( $_wp_additional_image_sizes[$s]['height'] ) : get_option( "{$s}_size_h" ) ;
|
35 |
+
|
36 |
+
//Set crop
|
37 |
+
$crop = isset( $_wp_additional_image_sizes[$s]['crop'] ) ? intval( $_wp_additional_image_sizes[$s]['crop'] ) : get_option( "{$s}_crop" ) ;
|
38 |
+
|
39 |
+
?>
|
40 |
+
<tr id="sis-<?php echo esc_attr( $s ) ?>">
|
41 |
+
<th class="check-column">
|
42 |
+
<input type="checkbox" class="thumbnails" id="<?php echo esc_attr( $s ) ?>" name="thumbnails[]" checked="checked" value="<?php echo esc_attr( $s ); ?>" />
|
43 |
+
</th>
|
44 |
+
<th>
|
45 |
+
<label for="<?php esc_attr_e( $s ); ?>"><?php echo esc_html( $s ); ?></label>
|
46 |
+
</th>
|
47 |
+
<th>
|
48 |
+
<label for="<?php esc_attr_e( $s ); ?>"><?php echo esc_html( $width); ?> px</label>
|
49 |
+
</th>
|
50 |
+
<th>
|
51 |
+
<label for="<?php esc_attr_e( $s ); ?>"><?php echo esc_html( $height ); ?> px</label>
|
52 |
+
</th>
|
53 |
+
<th>
|
54 |
+
<label for="<?php esc_attr_e( $s ); ?>"><?php echo ( $crop == 1 )? __( 'Yes', 'sis' ):__( 'No', 'sis' ); ?> </label>
|
55 |
+
</th>
|
56 |
+
</tr>
|
57 |
+
<?php endforeach;?>
|
58 |
+
</tbody>
|
59 |
+
<tfoot>
|
60 |
+
<tr>
|
61 |
+
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
|
62 |
+
<th class="manage-column" scope="col"><?php _e( 'Size name', 'sis'); ?></th>
|
63 |
+
<th class="manage-column" scope="col"><?php _e( 'Width', 'sis'); ?></th>
|
64 |
+
<th class="manage-column" scope="col"><?php _e( 'Height', 'sis'); ?></th>
|
65 |
+
<th class="manage-column" scope="col"><?php _e( 'Crop ?', 'sis'); ?></th>
|
66 |
+
</tr>
|
67 |
+
</tfoot>
|
68 |
+
</table>
|
69 |
+
|
70 |
+
<h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'sis'); ?></h4>
|
71 |
+
<table cellspacing="0" class="widefat page fixed sis">
|
72 |
+
<thead>
|
73 |
+
<tr>
|
74 |
+
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
|
75 |
+
<th class="manage-column" scope="col"><?php _e( 'Post type', 'sis'); ?></th>
|
76 |
+
</tr>
|
77 |
+
</thead>
|
78 |
+
<tbody>
|
79 |
+
<?php
|
80 |
+
// Diplay the post types table
|
81 |
+
foreach ( get_post_types( array( 'public' => true, '_builtin' => false ), 'objects', 'or' ) as $ptype ):
|
82 |
+
// Avoid the post_types without post thumbnails feature
|
83 |
+
if( !array_key_exists( 'thumbnail' , $_wp_post_type_features[$ptype->name] ) || $_wp_post_type_features[$ptype->name] == false ) {
|
84 |
+
continue;
|
85 |
+
}
|
86 |
+
?>
|
87 |
+
<tr>
|
88 |
+
<th class="check-column">
|
89 |
+
<label for="<?php esc_attr_e( $ptype->name ); ?>">
|
90 |
+
<input type="checkbox" class="post_types" name="post_types[]" checked="checked" id="<?php echo esc_attr( $ptype->name ); ?>" value="<?php echo esc_attr( $ptype->name ); ?>" />
|
91 |
+
</label>
|
92 |
+
</th>
|
93 |
+
<th>
|
94 |
+
<label for="<?php esc_attr_e( $ptype->name ); ?>"><em><?php echo esc_html( $ptype->labels->name ); ?></em></label>
|
95 |
+
</th>
|
96 |
+
</tr>
|
97 |
+
<?php endforeach;?>
|
98 |
+
</tbody>
|
99 |
+
<tfoot>
|
100 |
+
<tr>
|
101 |
+
<th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked" type="checkbox"></th>
|
102 |
+
<th class="manage-column" scope="col"><?php _e( 'Post type', 'sis'); ?></th>
|
103 |
+
</tr>
|
104 |
+
</tfoot>
|
105 |
+
</table>
|
106 |
+
</div>
|
107 |
+
</div>
|
108 |
+
<div >
|
109 |
+
<div id="regenerate_message"></div>
|
110 |
+
<div class="progress"></div>
|
111 |
+
<div id="sis_progress-percent" class="hidden" >0%</div>
|
112 |
+
<div class="ui-widget" id="time">
|
113 |
+
<div class="ui-state-highlight ui-corner-all">
|
114 |
+
<p>
|
115 |
+
<span class="ui-icon ui-icon-info"></span>
|
116 |
+
<span><strong><?php _e( 'End time calculated :', 'sis' ); ?></strong> <span class='time_message'><?php _e( 'Calculating...', 'sis' ) ?></span> </span>
|
117 |
+
</p>
|
118 |
+
<ul class="messages"></ul>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
<div id="error_messages">
|
122 |
+
<p>
|
123 |
+
<ol class="messages">
|
124 |
+
</ol>
|
125 |
+
</p>
|
126 |
+
</div>
|
127 |
+
<div id="thumb"><h4><?php _e( 'Last image:', 'sis'); ?></h4><img id="thumb-img" /></div>
|
128 |
+
<input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild" value="<?php _e( 'Regenerate Thumbnails', 'sis' ) ?>" />
|
129 |
+
</div>
|