VA_Install::upload_image( int $post_id, string $file, string $desc = null, bool $featured = false, array $post_data = array() )
Upload an image to the media library.
Package
Description Description
Parameters Parameters
- $post_id
(int) (Required) The ID of the post to which the image is attached.
- $file
(string) (Required) The full path of the image (http url or local absolute path).
- $desc
(string) (Optional) The image description (optional).
Default value: null
- $featured
(bool) (Optional) Set the featured image.
Default value: false
- $post_data
(array) (Optional) Post data to override.
Default value: array()
Return Return
((int|false)) The image post ID on success.
Changelog Changelog
Version | Description |
---|---|
4.0.0 | Introduced. |