get_attachment_innerHTML

Retrieve HTML content of image element.

Description

(false|string) get_attachment_innerHTML( (int) $id = 0, (constant) $fullsize = false, (constant) $max_dims = false ); 

Returns (false|string)

Parameters (3)

0. $id — Optional. (int)
Post ID.
1. $fullsize — Optional. (constant) => false
Optional, default to false. Whether to have full size image.
2. $max_dims — Optional. (constant) => false
Dimensions of image.

Usage

  1. if ( !function_exists( 'get_attachment_innerHTML' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // Optional. Post ID. 
  5. $id = -1; 
  6.  
  7. // Optional, default to false. Whether to have full size image. 
  8. $fullsize = false; 
  9.  
  10. // Optional. Dimensions of image. 
  11. $max_dims = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = get_attachment_innerHTML($id, $fullsize, $max_dims); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { 
  2. _deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image()' ); 
  3. $id = (int) $id; 
  4. if ( !$post = get_post($id) ) 
  5. return false; 
  6.  
  7. if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims)) 
  8. return $innerHTML; 
  9.  
  10. $innerHTML = esc_attr($post->post_title); 
  11.  
  12. return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);