PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 9.2
Jetpack – WP Security, Backup, Speed, & Growth v9.2
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / modules / theme-tools / devicepx.php

devicepx.php in Jetpack – WP Security, Backup, Speed, & Growth 9.2, at modules/theme-tools/devicepx.php

40 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Loads the devicepx library which improves the resolution of gravatars and
4 * wordpress.com uploads on hi-res and zoomed browsers.
5 *
6 * This feature will only be activated for themes that declare their support.
7 * This can be done by adding code similar to the following during the
8 * 'after_setup_theme' action:
9 *
10 * add_theme_support( 'jetpack-devicepx' );
11 *
12 * @package Jetpack.
13 */
14
15 /**
16 * Enqueue the devicepx JS library, if enabled. The feature must
17 * be enabled earlier during `after_setup_theme`.
18 *
19 * @uses current_theme_supports, add_action
20 */
21 function jetpack_devicepx_init() {
22 if ( current_theme_supports( 'jetpack-devicepx' ) ) {
23 add_action( 'wp_enqueue_scripts', 'jetpack_devicepx_enqueue' );
24 add_action( 'customize_controls_enqueue_scripts', 'jetpack_devicepx_enqueue' );
25 add_action( 'admin_enqueue_scripts', 'jetpack_devicepx_enqueue' );
26 }
27 }
28
29 // Use a late priority to ensure that plugins and themes can enable or disable this feature.
30 add_action( 'init', 'jetpack_devicepx_init', 99 );
31
32 /**
33 * Enqueue the devicepx JS library.
34 *
35 * @uses wp_enqueue_script
36 */
37 function jetpack_devicepx_enqueue() {
38 wp_enqueue_script( 'devicepx', 'https://s0.wp.com/wp-content/js/devicepx-jetpack.js', array(), gmdate( 'oW' ), true );
39 }
40