As of v1.5 you will not need to manually add this at all. You don’t currently have to add it manually in Transitional mode or Standard mode. You only need to add it in Reader mode if the iframe is not in the content. When you have an iframe
outside the content in Reader mode, you currently should use this code:
add_filter( 'amp_post_template_data', function( $data ) {
$data['amp_component_scripts'] = array_merge(
$data['amp_component_scripts'],
array(
'amp-iframe' => true,
)
);
return $data;
} );
However, this will only be needed for the next 2 weeks. After v1.5 is released, it will have no effect.