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()


    Top ↑

    Return Return

    ((int|false)) The image post ID on success.


    Top ↑

    Changelog Changelog

    Changelog
    VersionDescription
    4.0.0Introduced.

    Premium WordPress Apps