diff options
Diffstat (limited to 'plugins/jetpack/3rd-party/class.jetpack-amp-support.php')
-rw-r--r-- | plugins/jetpack/3rd-party/class.jetpack-amp-support.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/jetpack/3rd-party/class.jetpack-amp-support.php b/plugins/jetpack/3rd-party/class.jetpack-amp-support.php index 4a5b7bd3..39520636 100644 --- a/plugins/jetpack/3rd-party/class.jetpack-amp-support.php +++ b/plugins/jetpack/3rd-party/class.jetpack-amp-support.php @@ -12,6 +12,11 @@ class Jetpack_AMP_Support { return; } + // enable stats + if ( Jetpack::is_module_active( 'stats' ) ) { + add_action( 'amp_post_template_footer', array( 'Jetpack_AMP_Support', 'add_stats_pixel' ) ); + } + // carousel add_filter( 'jp_carousel_maybe_disable', '__return_true' ); @@ -116,6 +121,18 @@ class Jetpack_AMP_Support { } /** + * Add Jetpack stats pixel. + * + * @since 6.2.1 + */ + static function add_stats_pixel() { + if ( ! has_action( 'wp_footer', 'stats_footer' ) ) { + return; + } + stats_render_amp_footer( stats_build_view_data() ); + } + + /** * Add publisher and image metadata to legacy AMP post. * * @since 6.2.0 |