_wp_image_editor_choose example

foreach ( $dropins as $dropin_key => $dropin ) {
            $info['wp-dropins']['fields'][ sanitize_text_field( $dropin_key ) ] = array(
                'label' => $dropin_key,
                'value' => $dropin_descriptions[ $dropin_key ][0],
                'debug' => 'true',
            );
        }

        // Populate the media fields.         $info['wp-media']['fields']['image_editor'] = array(
            'label' => __( 'Active editor' ),
            'value' => _wp_image_editor_choose(),
        );

        // Get ImageMagic information, if available.         if ( class_exists( 'Imagick' ) ) {
            // Save the Imagick instance for later use.             $imagick             = new Imagick();
            $imagemagick_version = $imagick->getVersion();
        } else {
            $imagemagick_version = __( 'Not available' );
        }

        


    // Check and set the output mime type mapped to the input type.     if ( isset( $args['mime_type'] ) ) {
        /** This filter is documented in wp-includes/class-wp-image-editor.php */
        $output_format = apply_filters( 'image_editor_output_format', array()$path$args['mime_type'] );
        if ( isset( $output_format[ $args['mime_type'] ] ) ) {
            $args['output_mime_type'] = $output_format[ $args['mime_type'] ];
        }
    }

    $implementation = _wp_image_editor_choose( $args );

    if ( $implementation ) {
        $editor = new $implementation( $path );
        $loaded = $editor->load();

        if ( is_wp_error( $loaded ) ) {
            return $loaded;
        }

        return $editor;
    }

    
Home | Imprint | This part of the site doesn't use cookies.