compat
2 years ago
content-options
2 years ago
js
6 years ago
responsive-videos
3 years ago
site-logo
3 years ago
social-menu
2 years ago
content-options.php
4 years ago
devicepx.php
5 years ago
featured-content.php
3 years ago
infinite-scroll.php
4 years ago
random-redirect.php
3 years ago
responsive-videos.php
2 years ago
site-breadcrumbs.php
3 years ago
site-logo.php
4 years ago
social-links.php
3 years ago
social-menu.php
4 years ago
devicepx.php
40 lines
| 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 automattic/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 |