wp_image_editor_supports example


    if ( wp_is_mobile()
        && str_contains( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' )
        && str_contains( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' )
    ) {
        $defaults['multi_selection'] = false;
    }

    // Check if WebP images can be edited.     if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/webp' ) ) ) {
        $defaults['webp_upload_error'] = true;
    }

    /** * Filters the Plupload default settings. * * @since 3.4.0 * * @param array $defaults Default Plupload settings array. */
    $defaults = apply_filters( 'plupload_default_settings', $defaults );

    

    $media_dims = apply_filters( 'media_meta', $media_dims$post );

    $image_edit_button = '';

    if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
        $nonce             = wp_create_nonce( "image_editor-$post->ID" );
        $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";
    }

    $attachment_url = get_permalink( $attachment_id );

    $item = " $type_html $toggle_links $order $display_title <table class='slidetoggle describe
<?php echo $post_id; ?>"> <?php echo $note; ?> <div class="imgedit-panel-content imgedit-panel-tools wp-clearfix"> <div class="imgedit-menu wp-clearfix"> <button type="button" onclick="imageEdit.toggleCropTool( <?php echo "$post_id, '$nonce'"; ?>, this );" aria-expanded="false" aria-controls="imgedit-crop" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button> <button type="button" class="imgedit-scale button" onclick="imageEdit.toggleControls(this);" aria-expanded="false" aria-controls="imgedit-scale"><?php esc_html_e( 'Scale' ); ?></button> <div class="imgedit-rotate-menu-container"> <button type="button" aria-controls="imgedit-rotate-menu" class="imgedit-rotate button" aria-expanded="false" onclick="imageEdit.togglePopup(this)"><?php esc_html_e( 'Image Rotation' ); ?></button> <div id="imgedit-rotate-menu" class="imgedit-popup-menu"> <?php             // On some setups GD library does not provide imagerotate() - Ticket #11536.             if ( wp_image_editor_supports(
                array(
                    'mime_type' => get_post_mime_type( $post_id ),
                    'methods'   => array( 'rotate' ),
                )
            ) ) {
                $note_no_rotate = '';
                ?> <button type="button" class="imgedit-rleft button" onkeyup="imageEdit.browsePopup(this)" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate 90° left' ); ?></button> <button type="button" class="imgedit-rright button" onkeyup="imageEdit.browsePopup(this)" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate 90° right' ); ?></button> <button type="button" class="imgedit-rfull button" onkeyup="imageEdit.browsePopup(this)" onclick="imageEdit.rotate(180, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate 180°' ); ?></button> <?php
Home | Imprint | This part of the site doesn't use cookies.