-
Notifications
You must be signed in to change notification settings - Fork 382
Closed as not planned
Closed as not planned
Copy link
Labels
EnhancementNew feature or improvement of an existing oneNew feature or improvement of an existing oneGroomedP1Medium priorityMedium priorityWS:CoreWork stream for Plugin coreWork stream for Plugin core
Description
There is currently an amp_skip_post which can be used to programmatically disable AMP for a given post. This is also needed for non-singular posts as well, as illustrated in this support topic: https://wordpress.org/support/topic/shortcodes-for-geo-mashup-not-working/
In the topic, a plugin is generating a template which is used to render inside of an amp-iframe. The iframed window is not an AMP page, as it needs to run JS. The hacky workaround can be see in this shim plugin I made: https://gist.github.com/westonruter/c3d4d73418b310f12d3cba7245fccebc
add_action( 'init', __NAMESPACE__ . '\remove_theme_support_on_geo_mashup_requests' );
/**
* On standard mode sites, prevent the page in the Geo Mashup iframe from being served as AMP, since it requires JavaScript.
*/
function remove_theme_support_on_geo_mashup_requests() {
if ( isset( $_GET['geo_mashup_content'] ) ) {
remove_theme_support( 'amp' );
}
}There needs to be an amp_skip filter for theme support to avoid having to hackily remove theme support.
Relates to #1778.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
EnhancementNew feature or improvement of an existing oneNew feature or improvement of an existing oneGroomedP1Medium priorityMedium priorityWS:CoreWork stream for Plugin coreWork stream for Plugin core
Type
Projects
Status
To Do