HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //var/www/html/qcr24/wp-content/plugins/svg-support/functions/thumbnail-display.php
<?php
/**
 * ADD ABILITY TO VIEW THUMBNAILS IN WP 4.0+
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

add_action( 'admin_init', 'bodhi_svgs_display_thumbs' );
function bodhi_svgs_display_thumbs() {

	if ( bodhi_svgs_specific_pages_media_library() ) {

		function bodhi_svgs_thumbs_filter( $content ) {

			return apply_filters( 'final_output', $content );

		}

		ob_start( 'bodhi_svgs_thumbs_filter' );

		add_filter( 'final_output', 'bodhi_svgs_final_output' );
		function bodhi_svgs_final_output( $content ) {

			$content = str_replace(
				'<# } else if ( \'image\' === data.type && data.sizes && data.sizes.full ) { #>',
				'<# } else if ( \'svg+xml\' === data.subtype ) { #>
					<img class="details-image" src="{{ data.url }}" draggable="false" />
					<# } else if ( \'image\' === data.type && data.sizes && data.sizes.full ) { #>',

					$content
					);

			$content = str_replace(
				'<# } else if ( \'image\' === data.type && data.sizes ) { #>',
				'<# } else if ( \'svg+xml\' === data.subtype ) { #>
					<div class="centered">
						<img src="{{ data.url }}" class="thumbnail" draggable="false" />
					</div>
					<# } else if ( \'image\' === data.type && data.sizes ) { #>',

					$content
					);

			return $content;

		}

	}

}