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
if ( !function_exists( 'get_attachment_innerHTML' ) ) { require_once ABSPATH . WPINC . '/deprecated.php'; } // Optional. Post ID. $id = -1; // Optional, default to false. Whether to have full size image. $fullsize = false; // Optional. Dimensions of image. $max_dims = false; // NOTICE! Understand what this does before running. $result = get_attachment_innerHTML($id, $fullsize, $max_dims);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/deprecated.php
- function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
- _deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image()' );
- $id = (int) $id;
- if ( !$post = get_post($id) )
- return false;
- if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
- return $innerHTML;
- $innerHTML = esc_attr($post->post_title);
- return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
- }