From ab99cd7606c00cbeadf01684a9b37685963165b7 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 1 Jun 2018 23:33:19 -0700 Subject: [PATCH] Note pre_amp_render_post action being not called when amp theme support added --- amp.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/amp.php b/amp.php index a3911bb3396..79e32abed81 100644 --- a/amp.php +++ b/amp.php @@ -331,10 +331,11 @@ function amp_add_post_template_actions() { * Add action to do post template rendering at template_redirect action. * * @since 0.2 + * @since 1.0 The amp_render() function is called at template_redirect action priority 11 instead of priority 10. * @deprecated This function is not used when 'amp' theme support is added. */ function amp_prepare_render() { - add_action( 'template_redirect', 'amp_render' ); + add_action( 'template_redirect', 'amp_render', 11 ); } /** @@ -390,6 +391,8 @@ function amp_render_post( $post ) { /** * Fires before rendering a post in AMP. * + * This action is not triggered when 'amp' theme support is present. Instead, you should use 'template_redirect' action and check if `is_amp_endpoint()`. + * * @since 0.2 * * @param int $post_id Post ID.