WordPress.org

Ready to get started?Download WordPress

Forums

How do I automatically rename media with post's name to which it is attached? (1 post)

  1. Nexutix
    Member
    Posted 2 years ago #

    Here's what I want to do:

    When I upload an image attachment via my iOS app, the real filename should be renamed as "Original filename string"+"Post_title of the post it is attached to"

    I am sure I can write a plugin for that, but how do I get post_title from WordPress database for that particular attachment? I am uploading multiple image attachment, thus keeping original filename attached to post_title will be easy renaming process. How do I call the function when image is attached to a post? I am kinda new in PHP.

    Any help would be appreciated. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic