Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Connection_Assets
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 configure
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 register_assets
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Connection_Assets.
4 *
5 * @package automattic/jetpack-connection
6 */
7
8namespace Automattic\Jetpack\Connection;
9
10use Automattic\Jetpack\Assets;
11
12/**
13 * Connection_Assets class.
14 */
15class Connection_Assets {
16
17    /**
18     * Initialize the class.
19     */
20    public static function configure() {
21        add_action( 'wp_loaded', array( __CLASS__, 'register_assets' ) );
22
23        add_filter( 'jetpack_admin_js_script_data', array( Initial_State::class, 'set_connection_script_data' ), 10, 1 );
24    }
25
26    /**
27     * Register assets.
28     *
29     * NOTICE: Please think twice before including Connection scripts in the frontend.
30     * Those scripts are intended to be used in WP admin area.
31     */
32    public static function register_assets() {
33
34        Assets::register_script(
35            'jetpack-connection',
36            '../dist/jetpack-connection.js',
37            __FILE__,
38            array(
39                'in_footer'  => true,
40                'textdomain' => 'jetpack-connection',
41            )
42        );
43    }
44}