Home Forums General Issues File field + Youtube API


File field + Youtube API

  • Hi,

    i start a project and i want to use ACF fo what i need :
    i need a field which can post a video on youtube with API. Do you think i can do that with a file field and piece of code after saving post ?
    And is it possible to check file extension of the file uploaded with file field ?

    Thanks a lot for your help


  • Hi @benoit

    In short, yes.

    ACF makes it very easy to define a new field type. Check out the docs for that one.

    As for the file uploader, there is not much documentation on the net for WP’s uploader which made my life very difficult. You are more than welcome to look through the source JS code and see how ACF uses the object.

    Good luck mate!


  • Hi @elliot,

    thanks for your reply. I think file field is ok for my work because i want to send the video on youtube after the administrator will publish the post. I will test with post action publish_post… Do you think it is possible ?

  • Yes, this should be possible.

    You should use the acf/update_value filter to hook in and do some custom saving for the exact field you want.

    Lots of code examples on the docs page.


Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘File field + Youtube API’ is closed to new replies.