| | 52 | <div class="imgedit-group"> |
| | 53 | <div class="imgedit-group-top imgedit-menu"> |
| | 54 | <h2><?php _e( 'Editing Tools' ); ?></h2> |
| | 55 | <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button> |
| | 56 | <?php |
| | 57 | |
| | 58 | // On some setups GD library does not provide imagerotate() - Ticket #11536 |
| | 59 | if ( wp_image_editor_supports( |
| | 60 | array( |
| | 61 | 'mime_type' => get_post_mime_type( $post_id ), |
| | 62 | 'methods' => array( 'rotate' ), |
| | 63 | ) |
| | 64 | ) ) { |
| | 65 | $note_no_rotate = ''; |
| | 66 | ?> |
| | 67 | <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate counter-clockwise' ); ?></button> |
| | 68 | <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate clockwise' ); ?></button> |
| | 69 | <?php |
| | 70 | } else { |
| | 71 | $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>'; |
| | 72 | ?> |
| | 73 | <button type="button" class="imgedit-rleft button disabled" disabled></button> |
| | 74 | <button type="button" class="imgedit-rright button disabled" disabled></button> |
| | 75 | <?php } ?> |
| | 76 | |
| | 77 | <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><?php esc_html_e( 'Flip vertically' ); ?></button> |
| | 78 | <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><?php esc_html_e( 'Flip horizontally' ); ?></button> |
| | 79 | |
| | 80 | <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> |
| | 81 | <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> |
| | 82 | <?php echo $note_no_rotate; ?> |
| | 83 | |
| | 84 | </div> |
| | 85 | </div> |
| 199 | | <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><span class="screen-reader-text"><?php esc_html_e( 'Crop' ); ?></span></button> |
| 200 | | <?php |
| 201 | | |
| 202 | | // On some setups GD library does not provide imagerotate() - Ticket #11536 |
| 203 | | if ( wp_image_editor_supports( |
| 204 | | array( |
| 205 | | 'mime_type' => get_post_mime_type( $post_id ), |
| 206 | | 'methods' => array( 'rotate' ), |
| 207 | | ) |
| 208 | | ) ) { |
| 209 | | $note_no_rotate = ''; |
| 210 | | ?> |
| 211 | | <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><span class="screen-reader-text"><?php esc_html_e( 'Rotate counter-clockwise' ); ?></span></button> |
| 212 | | <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><span class="screen-reader-text"><?php esc_html_e( 'Rotate clockwise' ); ?></span></button> |
| 213 | | <?php |
| 214 | | } else { |
| 215 | | $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>'; |
| 216 | | ?> |
| 217 | | <button type="button" class="imgedit-rleft button disabled" disabled></button> |
| 218 | | <button type="button" class="imgedit-rright button disabled" disabled></button> |
| 219 | | <?php } ?> |
| 220 | | |
| 221 | | <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><span class="screen-reader-text"><?php esc_html_e( 'Flip vertically' ); ?></span></button> |
| 222 | | <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><span class="screen-reader-text"><?php esc_html_e( 'Flip horizontally' ); ?></span></button> |
| 223 | | |
| 224 | | <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><span class="screen-reader-text"><?php esc_html_e( 'Undo' ); ?></span></button> |
| 225 | | <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><span class="screen-reader-text"><?php esc_html_e( 'Redo' ); ?></span></button> |
| 226 | | <?php echo $note_no_rotate; ?> |
| | 233 | test |