Home › Forums › General Issues › How to add captions to videos for ADA compliance? › Reply To: How to add captions to videos for ADA compliance?
if you are looking for this for use in an oembed field, this uses the built in oembed feature of WP. As far as I know, WP does not have the ability you’re looking for. https://wordpress.org/support/article/embeds/
In order to add anything to the output of an oembed provided by WP you would need to create filters on the output. This can be done using the embed_oembed_html and/or oembed_result hooks. Both of these hooks supply the HTML for the embed and you would need to parse the HTML and insert additional elements as needed.
If you can do that you could use a different ACF field to hold something to be inserted. However, there would not be much available in to the filter to allow you to match up the video being shown with any additional fields that you want to pull information from. You would need to somehow use the url of the video to find out what field that url was pulled from and then find the field that has your additional data.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.