File: /home/bt667/public_html/wp-content/plugins/auto-sizes/hooks.php
<?php
/**
* Hook callbacks used for Enhanced Responsive Images.
*
* @package auto-sizes
* @since 1.0.0
*/
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Displays the HTML generator tag for the plugin.
*
* See {@see 'wp_head'}.
*
* @since 1.0.1
*/
function auto_sizes_render_generator(): void {
// Use the plugin slug as it is immutable.
echo '<meta name="generator" content="auto-sizes ' . esc_attr( IMAGE_AUTO_SIZES_VERSION ) . '">' . "\n";
}
add_action( 'wp_head', 'auto_sizes_render_generator' );
/**
* Filters related to the improved image sizes functionality.
*/
add_filter( 'the_content', 'auto_sizes_prime_attachment_caches', 9 ); // This must run before 'do_blocks', which runs at priority 9.
add_filter( 'render_block_core/image', 'auto_sizes_filter_image_tag', 10, 3 );
add_filter( 'render_block_core/cover', 'auto_sizes_filter_image_tag', 10, 3 );
add_filter( 'render_block_core/post-featured-image', 'auto_sizes_filter_image_tag', 10, 3 );
add_filter( 'get_block_type_uses_context', 'auto_sizes_filter_uses_context', 10, 2 );
add_filter( 'render_block_context', 'auto_sizes_filter_render_block_context', 10, 3 );
// @codeCoverageIgnoreEnd