WordPress.org

Ready to get started?Download WordPress

Forums

Use PHP to add new media. (1 post)

  1. sogorman
    Member
    Posted 2 years ago #

    Hello all! I am trying to tackle what I think is a two step process.

    1) Use PHP to upload and add a new piece of media

    2) Use PHP to set the featured image for a known post ID to the media ID I just uploaded.

    I think I found a function to cover the second part but I am struggling to come up with a solution that will allow me to programmatically upload media to the media library. Any tips or advice would be appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic