Make WordPress Core

Changeset 60278


Ignore:
Timestamp:
06/05/2025 08:14:30 AM (6 weeks ago)
Author:
adamsilverstein
Message:

Site Health: add image output mapping details to the info tab.

Add details to the info tab under media handling to show the mapping from uploaded image types to output types.

Props ironprogrammer, yogeshbhutkar.

Fixes #63047.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-debug-data.php

    r60274 r60278  
    683683        }
    684684
     685        // Get the image format transforms.
     686        $mappings           = wp_get_image_editor_output_format( '', '' );
     687        $formatted_mappings = array();
     688
     689        if ( ! empty( $mappings ) ) {
     690            foreach ( $mappings as $format => $mime_type ) {
     691                $formatted_mappings[] = sprintf( '%s → %s', $format, $mime_type );
     692            }
     693            $mappings_display = implode( ', ', $formatted_mappings );
     694        } else {
     695            $mappings_display = __( 'No format transforms defined' );
     696        }
     697
     698        $fields['image_format_transforms'] = array(
     699            'label' => __( 'Image format transforms' ),
     700            'value' => $mappings_display,
     701            'debug' => ( empty( $mappings ) ) ? 'No format transforms defined' : $mappings_display,
     702        );
     703
    685704        // Get GD information, if available.
    686705        if ( function_exists( 'gd_info' ) ) {
Note: See TracChangeset for help on using the changeset viewer.