| 58 | | |
| 59 | | <div class="imgedit-panel-content wp-clearfix"> |
| 60 | | <?php echo $note; ?> |
| 61 | | <div class="imgedit-menu wp-clearfix"> |
| 62 | | <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button> |
| 63 | | <?php |
| 64 | | |
| 65 | | // On some setups GD library does not provide imagerotate() - Ticket #11536. |
| 66 | | if ( wp_image_editor_supports( |
| 67 | | array( |
| 68 | | 'mime_type' => get_post_mime_type( $post_id ), |
| 69 | | 'methods' => array( 'rotate' ), |
| 70 | | ) |
| 71 | | ) ) { |
| 72 | | $note_no_rotate = ''; |
| 73 | | ?> |
| 74 | | <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate left' ); ?></button> |
| 75 | | <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate right' ); ?></button> |
| 76 | | <?php |
| 77 | | } else { |
| 78 | | $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>'; |
| 79 | | ?> |
| 80 | | <button type="button" class="imgedit-rleft button disabled" disabled></button> |
| 81 | | <button type="button" class="imgedit-rright button disabled" disabled></button> |
| 82 | | <?php } ?> |
| 83 | | |
| 84 | | <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><?php esc_html_e( 'Flip vertical' ); ?></button> |
| 85 | | <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><?php esc_html_e( 'Flip horizontal' ); ?></button> |
| 86 | | |
| 87 | | <br class="imgedit-undo-redo-separator" /> |
| 88 | | <button type="button" id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo button disabled" disabled><?php esc_html_e( 'Undo' ); ?></button> |
| 89 | | <button type="button" id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo button disabled" disabled><?php esc_html_e( 'Redo' ); ?></button> |
| 90 | | <?php echo $note_no_rotate; ?> |
| 91 | | </div> |
| 92 | | |
| | 58 | <input type="hidden" id="imgedit-nonce-<?php echo $post_id; ?>" value="<?php echo $nonce; ?>" /> |
| 100 | | <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> |
| 101 | | <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" |
| 102 | | src="<?php echo esc_url( admin_url( 'admin-ajax.php', 'relative' ) ) . '?action=imgedit-preview&_ajax_nonce=' . $nonce . '&postid=' . $post_id . '&rand=' . rand( 1, 99999 ); ?>" alt="" /> |
| 103 | | </div> |
| | 66 | <div class="imgedit-panel-content wp-clearfix"> |
| | 67 | <div class="imgedit-tools"> |
| | 68 | <?php echo $note; ?> |
| | 69 | <div class="imgedit-menu wp-clearfix"> |
| | 70 | <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this );imageEdit.toggleControls(this);" aria-expanded="false" aria-controls="imgedit-crop" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button> |
| | 71 | <button type="button" class="imgedit-scale button" onclick="imageEdit.toggleControls(this);" aria-expanded="false" aria-controls="imgedit-scale"><?php esc_html_e( 'Scale' ); ?></button> |
| 111 | | <div class="imgedit-settings"> |
| 112 | | <div class="imgedit-group"> |
| 113 | | <div class="imgedit-group-top"> |
| 114 | | <h2><?php _e( 'Scale Image' ); ?></h2> |
| 115 | | <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Scale Image Help' ); ?></span></button> |
| 116 | | <div class="imgedit-help"> |
| 117 | | <p><?php _e( 'You can proportionally scale the original image. For best results, scaling should be done before you crop, flip, or rotate. Images can only be scaled down, not up.' ); ?></p> |
| 118 | | </div> |
| 119 | | <?php if ( isset( $meta['width'], $meta['height'] ) ) : ?> |
| 120 | | <p> |
| 121 | | <?php |
| 122 | | printf( |
| 123 | | /* translators: %s: Image width and height in pixels. */ |
| 124 | | __( 'Original dimensions %s' ), |
| 125 | | '<span class="imgedit-original-dimensions">' . $meta['width'] . ' × ' . $meta['height'] . '</span>' |
| 126 | | ); |
| 127 | | ?> |
| 128 | | </p> |
| 129 | | <?php endif; ?> |
| 130 | | <div class="imgedit-submit"> |
| | 75 | // On some setups GD library does not provide imagerotate() - Ticket #11536. |
| | 76 | if ( wp_image_editor_supports( |
| | 77 | array( |
| | 78 | 'mime_type' => get_post_mime_type( $post_id ), |
| | 79 | 'methods' => array( 'rotate' ), |
| | 80 | ) |
| | 81 | ) ) { |
| | 82 | $note_no_rotate = ''; |
| | 83 | ?> |
| | 84 | <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate left' ); ?></button> |
| | 85 | <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate right' ); ?></button> |
| | 86 | <?php |
| | 87 | } else { |
| | 88 | $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>'; |
| | 89 | ?> |
| | 90 | <button type="button" class="imgedit-rleft button disabled" disabled></button> |
| | 91 | <button type="button" class="imgedit-rright button disabled" disabled></button> |
| | 92 | <?php } ?> |
| 132 | | <fieldset class="imgedit-scale"> |
| 133 | | <legend><?php _e( 'New dimensions:' ); ?></legend> |
| 134 | | <div class="nowrap"> |
| 135 | | <label for="imgedit-scale-width-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'scale width' ); ?></label> |
| 136 | | <input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> |
| 137 | | <span class="imgedit-separator" aria-hidden="true">×</span> |
| 138 | | <label for="imgedit-scale-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'scale height' ); ?></label> |
| 139 | | <input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> |
| 140 | | <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span> |
| 141 | | <div class="imgedit-scale-button-wrapper"><input id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" /></div> |
| 142 | | </div> |
| 143 | | </fieldset> |
| | 94 | <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><?php esc_html_e( 'Flip vertical' ); ?></button> |
| | 95 | <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><?php esc_html_e( 'Flip horizontal' ); ?></button> |
| 149 | | <?php if ( $can_restore ) { ?> |
| | 100 | <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> |
| | 101 | <div class="imgedit-crop-grid"></div> |
| | 102 | <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" |
| | 103 | src="<?php echo esc_url( admin_url( 'admin-ajax.php', 'relative' ) ) . '?action=imgedit-preview&_ajax_nonce=' . $nonce . '&postid=' . $post_id . '&rand=' . rand( 1, 99999 ); ?>" alt="" /> |
| | 104 | </div> |
| | 105 | </div> |
| | 106 | <div class="imgedit-settings"> |
| | 107 | <div class="imgedit-tool-active"> |
| | 108 | <div class="imgedit-group"> |
| | 109 | <div id="imgedit-scale" tabindex="-1" class="imgedit-group-controls"> |
| | 110 | <div class="imgedit-group-top"> |
| | 111 | <h2><?php _e( 'Scale Image' ); ?></h2> |
| | 112 | <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Scale Image Help' ); ?></span></button> |
| | 113 | <div class="imgedit-help"> |
| | 114 | <p><?php _e( 'You can proportionally scale the original image. For best results, scaling should be done before you crop, flip, or rotate. Images can only be scaled down, not up.' ); ?></p> |
| | 115 | </div> |
| | 116 | <?php if ( isset( $meta['width'], $meta['height'] ) ) : ?> |
| | 117 | <p> |
| | 118 | <?php |
| | 119 | printf( |
| | 120 | /* translators: %s: Image width and height in pixels. */ |
| | 121 | __( 'Original dimensions %s' ), |
| | 122 | '<span class="imgedit-original-dimensions">' . $meta['width'] . ' × ' . $meta['height'] . '</span>' |
| | 123 | ); |
| | 124 | ?> |
| | 125 | </p> |
| | 126 | <?php endif; ?> |
| | 127 | <div class="imgedit-submit"> |
| 151 | | <div class="imgedit-group"> |
| 152 | | <div class="imgedit-group-top"> |
| 153 | | <h2><button type="button" onclick="imageEdit.toggleHelp(this);" class="button-link" aria-expanded="false"><?php _e( 'Restore original image' ); ?> <span class="dashicons dashicons-arrow-down imgedit-help-toggle"></span></button></h2> |
| 154 | | <div class="imgedit-help imgedit-restore"> |
| 155 | | <p> |
| 156 | | <?php |
| 157 | | _e( 'Discard any changes and restore the original image.' ); |
| | 129 | <fieldset class="imgedit-scale-controls"> |
| | 130 | <legend><?php _e( 'New dimensions:' ); ?></legend> |
| | 131 | <div class="nowrap"> |
| | 132 | <label for="imgedit-scale-width-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'scale width' ); ?></label> |
| | 133 | <input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> |
| | 134 | <span class="imgedit-separator" aria-hidden="true">×</span> |
| | 135 | <label for="imgedit-scale-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'scale height' ); ?></label> |
| | 136 | <input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> |
| | 137 | <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span> |
| | 138 | <button id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary"><?php esc_html_e( 'Scale' ); ?></button> |
| | 139 | </div> |
| | 140 | </fieldset> |
| 173 | | <div class="imgedit-group"> |
| 174 | | <div class="imgedit-group-top"> |
| 175 | | <h2><?php _e( 'Image Crop' ); ?></h2> |
| 176 | | <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Image Crop Help' ); ?></span></button> |
| | 149 | <div class="imgedit-group"> |
| | 150 | <div class="imgedit-group-top"> |
| | 151 | <h2><button type="button" onclick="imageEdit.toggleHelp(this);" class="button-link" aria-expanded="false"><?php _e( 'Restore original image' ); ?> <span class="dashicons dashicons-arrow-down imgedit-help-toggle"></span></button></h2> |
| | 152 | <div class="imgedit-help imgedit-restore"> |
| | 153 | <p> |
| | 154 | <?php |
| | 155 | _e( 'Discard any changes and restore the original image.' ); |
| 184 | | <p><strong><?php _e( 'Crop Selection' ); ?></strong><br /> |
| 185 | | <?php _e( 'Once you have made your selection, you can adjust it by entering the size in pixels. The minimum selection size is the thumbnail size as set in the Media settings.' ); ?></p> |
| 186 | | </div> |
| 187 | | </div> |
| | 171 | <div class="imgedit-group"> |
| | 172 | <div id="imgedit-crop" tabindex="-1" class="imgedit-group-controls"> |
| | 173 | <div class="imgedit-group-top"> |
| | 174 | <h2><?php _e( 'Crop Image' ); ?></h2> |
| | 175 | <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Image Crop Help' ); ?></span></button> |
| 189 | | <fieldset class="imgedit-crop-ratio"> |
| 190 | | <legend><?php _e( 'Aspect ratio:' ); ?></legend> |
| 191 | | <div class="nowrap"> |
| 192 | | <label for="imgedit-crop-width-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'crop ratio width' ); ?></label> |
| 193 | | <input type="text" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" /> |
| 194 | | <span class="imgedit-separator" aria-hidden="true">:</span> |
| 195 | | <label for="imgedit-crop-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'crop ratio height' ); ?></label> |
| 196 | | <input type="text" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" /> |
| 197 | | </div> |
| 198 | | </fieldset> |
| | 177 | <div class="imgedit-help"> |
| | 178 | <p><?php _e( 'To crop the image, click on it and drag to make your selection.' ); ?></p> |
| 200 | | <fieldset id="imgedit-crop-sel-<?php echo $post_id; ?>" class="imgedit-crop-sel"> |
| 201 | | <legend><?php _e( 'Selection:' ); ?></legend> |
| 202 | | <div class="nowrap"> |
| 203 | | <label for="imgedit-sel-width-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'selection width' ); ?></label> |
| 204 | | <input type="text" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" /> |
| 205 | | <span class="imgedit-separator" aria-hidden="true">×</span> |
| 206 | | <label for="imgedit-sel-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'selection height' ); ?></label> |
| 207 | | <input type="text" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" /> |
| 208 | | </div> |
| 209 | | </fieldset> |
| | 180 | <p><strong><?php _e( 'Crop Aspect Ratio' ); ?></strong><br /> |
| | 181 | <?php _e( 'The aspect ratio is the relationship between the width and height. You can preserve the aspect ratio by holding down the shift key while resizing your selection. Use the input box to specify the aspect ratio, e.g. 1:1 (square), 4:3, 16:9, etc.' ); ?></p> |
| 213 | | <?php |
| 214 | | if ( $thumb && $sub_sizes ) { |
| 215 | | $thumb_img = wp_constrain_dimensions( $thumb['width'], $thumb['height'], 160, 120 ); |
| 216 | | ?> |
| | 188 | <fieldset class="imgedit-crop-ratio"> |
| | 189 | <legend><?php _e( 'Aspect ratio:' ); ?></legend> |
| | 190 | <div class="nowrap"> |
| | 191 | <label for="imgedit-crop-width-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'Crop Ratio Width' ); ?></label> |
| | 192 | <input type="text" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" /> |
| | 193 | <span class="imgedit-separator" aria-hidden="true">:</span> |
| | 194 | <label for="imgedit-crop-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'Crop Ratio Height' ); ?></label> |
| | 195 | <input type="text" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" /> |
| | 196 | </div> |
| | 197 | </fieldset> |
| 218 | | <div class="imgedit-group imgedit-applyto"> |
| 219 | | <div class="imgedit-group-top"> |
| 220 | | <h2><?php _e( 'Thumbnail Settings' ); ?></h2> |
| 221 | | <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Thumbnail Settings Help' ); ?></span></button> |
| 222 | | <div class="imgedit-help"> |
| 223 | | <p><?php _e( 'You can edit the image while preserving the thumbnail. For example, you may wish to have a square thumbnail that displays just a section of the image.' ); ?></p> |
| 224 | | </div> |
| 225 | | </div> |
| | 199 | <fieldset id="imgedit-crop-sel-<?php echo $post_id; ?>" class="imgedit-crop-sel"> |
| | 200 | <legend><?php _e( 'Selection:' ); ?></legend> |
| | 201 | <div class="nowrap"> |
| | 202 | <label for="imgedit-sel-width-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'Width' ); ?></label> |
| | 203 | <input type="text" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" /> |
| | 204 | <span class="imgedit-separator" aria-hidden="true">×</span> |
| | 205 | <label for="imgedit-sel-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'Height' ); ?></label> |
| | 206 | <input type="text" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" /> |
| | 207 | </div> |
| | 208 | </fieldset> |
| 227 | | <figure class="imgedit-thumbnail-preview"> |
| 228 | | <img src="<?php echo $thumb['url']; ?>" width="<?php echo $thumb_img[0]; ?>" height="<?php echo $thumb_img[1]; ?>" class="imgedit-size-preview" alt="" draggable="false" /> |
| 229 | | <figcaption class="imgedit-thumbnail-preview-caption"><?php _e( 'Current thumbnail' ); ?></figcaption> |
| 230 | | </figure> |
| | 210 | <fieldset id="imgedit-crop-sel-<?php echo $post_id; ?>" class="imgedit-crop-sel"> |
| | 211 | <legend><?php _e( 'Starting Coordinates:' ); ?></legend> |
| | 212 | <div class="nowrap"> |
| | 213 | <label for="imgedit-start-x-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'X Position' ); ?></label> |
| | 214 | <input type="text" id="imgedit-start-x-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" value="0" /> |
| | 215 | <span class="imgedit-separator" aria-hidden="true">×</span> |
| | 216 | <label for="imgedit-start-y-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'Y Position' ); ?></label> |
| | 217 | <input type="text" id="imgedit-start-y-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" value="0" /> |
| | 218 | </div> |
| | 219 | </fieldset> |
| | 220 | <div class="imgedit-crop-apply container"> |
| | 221 | <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this );" class="imgedit-crop-apply button"><?php esc_html_e( 'Apply Crop' ); ?></button> |
| | 222 | </div> |
| | 223 | </div> |
| | 224 | </div> |
| 241 | | <span class="imgedit-label"> |
| 242 | | <input type="radio" id="imgedit-target-thumbnail" name="imgedit-target-<?php echo $post_id; ?>" value="thumbnail" /> |
| 243 | | <label for="imgedit-target-thumbnail"><?php _e( 'Thumbnail' ); ?></label> |
| 244 | | </span> |
| | 233 | <div class="imgedit-group imgedit-applyto"> |
| | 234 | <div class="imgedit-group-top"> |
| | 235 | <h2><?php _e( 'Thumbnail Settings' ); ?></h2> |
| | 236 | <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Thumbnail Settings Help' ); ?></span></button> |
| | 237 | <div class="imgedit-help"> |
| | 238 | <p><?php _e( 'You can edit the image while preserving the thumbnail. For example, you may wish to have a square thumbnail that displays just a section of the image.' ); ?></p> |
| | 239 | </div> |
| | 240 | </div> |
| | 241 | <div class="imgedit-thumbnail-preview-group"> |
| | 242 | <figure class="imgedit-thumbnail-preview"> |
| | 243 | <img src="<?php echo $thumb['url']; ?>" width="<?php echo $thumb_img[0]; ?>" height="<?php echo $thumb_img[1]; ?>" class="imgedit-size-preview" alt="" draggable="false" /> |
| | 244 | <figcaption class="imgedit-thumbnail-preview-caption"><?php _e( 'Current thumbnail' ); ?></figcaption> |
| | 245 | </figure> |
| 246 | | <span class="imgedit-label"> |
| 247 | | <input type="radio" id="imgedit-target-nothumb" name="imgedit-target-<?php echo $post_id; ?>" value="nothumb" /> |
| 248 | | <label for="imgedit-target-nothumb"><?php _e( 'All sizes except thumbnail' ); ?></label> |
| 249 | | </span> |
| 250 | | <?php |
| 251 | | if ( $edit_custom_sizes ) { |
| 252 | | if ( ! is_array( $edit_custom_sizes ) ) { |
| 253 | | $edit_custom_sizes = get_intermediate_image_sizes(); |
| 254 | | } |
| 255 | | foreach ( array_unique( $edit_custom_sizes ) as $key => $size ) { |
| 256 | | if ( array_key_exists( $size, $meta['sizes'] ) ) { |
| 257 | | if ( 'thumbnail' === $size ) { |
| 258 | | continue; |
| 259 | | } |
| 260 | | ?> |
| 261 | | <span class="imgedit-label"> |
| 262 | | <input type="radio" id="imgedit-target-custom<?php echo esc_attr( $key ); ?>" name="imgedit-target-<?php echo $post_id; ?>" value="<?php echo esc_attr( $size ); ?>" /> |
| 263 | | <label for="imgedit-target-custom<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $size ); ?></label> |
| 264 | | </span> |
| 265 | | <?php |
| 266 | | } |
| 267 | | } |
| 268 | | } |
| 269 | | ?> |
| 270 | | </fieldset> |
| 271 | | </div> |
| 272 | | </div> |
| | 247 | <div id="imgedit-save-target-<?php echo $post_id; ?>" class="imgedit-save-target"> |
| | 248 | <fieldset> |
| | 249 | <legend><?php _e( 'Apply changes to:' ); ?></legend> |
| | 261 | <span class="imgedit-label"> |
| | 262 | <input type="radio" id="imgedit-target-nothumb" name="imgedit-target-<?php echo $post_id; ?>" value="nothumb" /> |
| | 263 | <label for="imgedit-target-nothumb"><?php _e( 'All sizes except thumbnail' ); ?></label> |
| | 264 | </span> |
| | 265 | <?php |
| | 266 | if ( $edit_custom_sizes ) { |
| | 267 | if ( ! is_array( $edit_custom_sizes ) ) { |
| | 268 | $edit_custom_sizes = get_intermediate_image_sizes(); |
| | 269 | } |
| | 270 | foreach ( array_unique( $edit_custom_sizes ) as $key => $size ) { |
| | 271 | if ( array_key_exists( $size, $meta['sizes'] ) ) { |
| | 272 | if ( 'thumbnail' === $size ) { |
| | 273 | continue; |
| | 274 | } |
| | 275 | ?> |
| | 276 | <span class="imgedit-label"> |
| | 277 | <input type="radio" id="imgedit-target-custom<?php echo esc_attr( $key ); ?>" name="imgedit-target-<?php echo $post_id; ?>" value="<?php echo esc_attr( $size ); ?>" /> |
| | 278 | <label for="imgedit-target-custom<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $size ); ?></label> |
| | 279 | </span> |
| | 280 | <?php |
| | 281 | } |
| | 282 | } |
| | 283 | } |
| | 284 | ?> |
| | 285 | </fieldset> |
| | 286 | </div> |
| | 287 | </div> |
| | 288 | </div> |
| | 289 | |
| | 290 | <?php } ?> |
| | 291 | |
| | 292 | <div class="imgedit-submit imgedit-menu"> |
| | 293 | <button type="button" id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo button disabled" disabled><?php esc_html_e( 'Undo' ); ?></button> |
| | 294 | <button type="button" id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo button disabled" disabled><?php esc_html_e( 'Redo' ); ?></button> |
| | 295 | <button type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button imgedit-cancel-btn"><?php esc_html_e( 'Cancel' ); ?></button> |
| | 296 | <button type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button button-primary imgedit-submit-btn"><?php esc_html_e( 'Save' ); ?></button> |
| | 297 | </div> |
| | 298 | </div> |
| | 299 | </div> |
| | 300 | |