You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In v0.7 we've added amp theme support where you can have the entire theme be served as AMP, not just the post templates. For example, you could have your blog index template be served as AMP now (see example site: https://ampdemo.xwp.io/). In that case, there is no $post_id to be passed as the arg for the pre_amp_render_post action. But you can see from the source that the pre_amp_render_post action actually runs at template_redirect (priority 10) anyway:
Since it's not intented to be used by plugin developers and a similar one ( _deprecated_function() ) was replaced in this commit #1141, i'm not sure if it would be fine to use it to output a warning.
In v0.7 we've added
amp
theme support where you can have the entire theme be served as AMP, not just the post templates. For example, you could have your blog index template be served as AMP now (see example site: https://ampdemo.xwp.io/). In that case, there is no$post_id
to be passed as the arg for thepre_amp_render_post
action. But you can see from the source that thepre_amp_render_post
action actually runs attemplate_redirect
(priority 10) anyway:https://github.com/Automattic/amp-wp/blob/7439d2ab5eebd0ee071749a849fda946a2eff4be/amp.php#L326-L383
As such, we should deprecate the
pre_amp_render_post
action entirely in favor of themes and plugins doing:The
pre_amp_render_post
action should only emit a deprecation warning whenamp
theme support is present.We could also consider adding a new action that gets triggered here instead, like
pre_amp_render_template
which does not pass any$post_id
arg.See #1125.
The text was updated successfully, but these errors were encountered: