Skip to content

Commit 9e18bd7

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@60278 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6278ab0 commit 9e18bd7

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/wp-admin/includes/class-wp-debug-data.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,25 @@ private static function get_wp_media(): array {
682682
);
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' ) ) {
687706
$gd = gd_info();

0 commit comments

Comments
 (0)