Does file_upload set attachment's post_parent to the custom post?

Support General Does file_upload set attachment's post_parent to the custom post?Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #43139
    Scott BrimScott Brim
    Participant

    Hi folks. I have a custom post type "resource". When a new "resource" is created and one of the fields is a file_upload, is the uploaded file attached to the created resource? That is, does file_upload set the uploaded file's post_parent to the resource post ID?

    I ask because on one particular site we want to search media file content (PDF, Docx) and make the result of the search is the related post, not the media file itself. That's very easy in Relevanssi, SearchWP, etc. as long as the media file is attached to the post. That happens when you're editing a usual post and add media. Does it happen for a custom post and a file_upload field?

    What about file_advanced, which apparently uses the standard Add Media interface.

    Thank you.

    #43141
    Scott BrimScott Brim
    Participant

    Never mind. The answer is yes. 😀

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.