Filter hook 'attachment_innerHTML'

in WP Core File wp-includes/deprecated.php at line 2006

View Source

attachment_innerHTML

Filter Hook
Description
Retrieve HTML content of image element.

Hook Information

File Location wp-includes/deprecated.php View on GitHub
Hook Type Filter
Line Number 2006

Hook Parameters

Type Name Description
int $id Optional. Post ID.
bool $fullsize Optional. Whether to have full size image. Default false.
array $max_dims Optional. Dimensions of image.

Usage Examples

Basic Usage
<?php
// Hook into attachment_innerHTML
add_filter('attachment_innerHTML', 'my_custom_filter', 10, 3);

function my_custom_filter($id, $fullsize, $max_dims) {
    // Your custom filtering logic here
    return $id;
}

Source Code Context

wp-includes/deprecated.php:2006 - How this hook is used in WordPress core
<?php
2001  	if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
2002  		return $innerHTML;
2003  
2004  	$innerHTML = esc_attr($post->post_title);
2005  
2006  	return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
2007  }
2008  
2009  /**
2010   * Retrieves bookmark data based on ID.
2011   *

PHP Documentation

<?php
/**
 * Retrieve HTML content of image element.
 *
 * @since 2.0.0
 * @deprecated 2.5.0 Use wp_get_attachment_image()
 * @see wp_get_attachment_image()
 *
 * @param int   $id       Optional. Post ID.
 * @param bool  $fullsize Optional. Whether to have full size image. Default false.
 * @param array $max_dims Optional. Dimensions of image.
 * @return string|false
 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/deprecated.php
Related Hooks

Related hooks will be displayed here in future updates.