Title: Analyze custom field
Last modified: August 17, 2018

---

# Analyze custom field

 *  Resolved [irdghz](https://wordpress.org/support/users/irdghz/)
 * (@irdghz)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/analyze-custom-field/)
 * I want to know if there is any way to analyze a custom area (FEATURED VIDEO FIELD)
   other than “post_amp_content” (SINGLE CONTENT) to detect a Youtube video and 
   return the script in the header:
 * “<script type=’text/javascript’ src=’[https://cdn.ampproject.org/v0/amp-youtube-latest.js&#8217](https://cdn.ampproject.org/v0/amp-youtube-latest.js&#8217);
   async custom-element=”amp-youtube”></script>”
 * Just analyze the shortcodes inside: “$ this-> get (‘post asp content’);” and 
   I need to “scan” that part above to return the script.
 * ScreenShot: [https://i.imgur.com/hPWN12i.png](https://i.imgur.com/hPWN12i.png)
 * Thanks for you help!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/analyze-custom-field/#post-10600689)
 * If using the legacy templates, the way you can add new such fields is using a
   snippet as shown in [https://github.com/Automattic/amp-wp/issues/440#issuecomment-399801866](https://github.com/Automattic/amp-wp/issues/440#issuecomment-399801866)
 * However, it should be much easier if you just used the new AMP theme support 
   in 1.0-beta2: [https://github.com/Automattic/amp-wp/wiki/Adding-Theme-Support](https://github.com/Automattic/amp-wp/wiki/Adding-Theme-Support)
 * Then you can just output a YouTube video as normal anywhere in the template and
   the required AMP component script will be added to the head.
 * You can download 1.0-beta2 here: [https://github.com/Automattic/amp-wp/releases/tag/1.0-beta2](https://github.com/Automattic/amp-wp/releases/tag/1.0-beta2)
 *  Thread Starter [irdghz](https://wordpress.org/support/users/irdghz/)
 * (@irdghz)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/analyze-custom-field/#post-10601754)
 * Thank you very much, I’ve been looking for a solution for hours.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Analyze custom field’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

## Tags

 * [featured](https://wordpress.org/support/topic-tag/featured/)
 * [video](https://wordpress.org/support/topic-tag/video/)
 * [Youtube](https://wordpress.org/support/topic-tag/youtube/)

 * 2 replies
 * 2 participants
 * Last reply from: [irdghz](https://wordpress.org/support/users/irdghz/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/analyze-custom-field/#post-10601754)
 * Status: resolved