wpseek.com
WordPress开发者和主题制作者的搜索引擎



get_attachment_innerhtml › WordPress Function

Since2.0.0
已弃用2.5.0
get_attachment_innerhtml ( $id = 0, $fullsize = false, $max_dims = false )
参数: (3)
  • (int) $id Optional. Post ID.
    Required: No
    默认:
  • (bool) $fullsize Optional. Whether to have full size image. Default false.
    Required: No
    默认: false
  • (array) $max_dims Optional. Dimensions of image.
    Required: No
    默认: false
查看:
返回:
  • (string|false)
定义在:
文档:

Retrieve HTML content of image element.



源码

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);
}