Core Function
View Source on Trac ↗ image_add_caption()
image_add_caption(
mixed $html,
mixed $id,
mixed $caption,
mixed $title,
mixed $align,
mixed $url,
mixed $size,
mixed $alt = ''
) Adds image shortcode with caption to editor.
Parameters 7 required
| Name / Type | Description |
|---|---|
| $html string | The image HTML markup to send. Required |
| $id int | Image attachment ID. Required |
| $caption string | Image caption. Required |
| $title string | Image title attribute (not used). Required |
| $align string | Image CSS alignment property. Required |
| $url string | Image source URL (not used). Required |
| $size string | Image size (not used). Required |
| $alt string | Image `alt` attribute (not used). |
Return Value
(string)
The image HTML markup with caption shortcode.
Function Information
Since Version
2.6.0
Source File
wp-admin/includes/media.php
Advertisement