| @@ 24-30 (lines=7) @@ | ||
| 21 | add_action( 'jetpack_user_authorized', array( __CLASS__, 'track_user_linked' ) ); |
|
| 22 | } |
|
| 23 | ||
| 24 | static function enqueue_tracks_scripts() { |
|
| 25 | wp_enqueue_script( 'jptracks', plugins_url( '_inc/lib/tracks/tracks-ajax.js', JETPACK__PLUGIN_FILE ), array(), JETPACK__VERSION, true ); |
|
| 26 | wp_localize_script( 'jptracks', 'jpTracksAJAX', array( |
|
| 27 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), |
|
| 28 | 'jpTracksAJAX_nonce' => wp_create_nonce( 'jp-tracks-ajax-nonce' ), |
|
| 29 | ) ); |
|
| 30 | } |
|
| 31 | ||
| 32 | /* User has linked their account */ |
|
| 33 | static function track_user_linked() { |
|
| @@ 141-158 (lines=18) @@ | ||
| 138 | * |
|
| 139 | * @since 4.4.0 |
|
| 140 | */ |
|
| 141 | function enqueue_banner_scripts() { |
|
| 142 | wp_enqueue_script( |
|
| 143 | 'jetpack-connection-banner-js', |
|
| 144 | plugins_url( '_inc/jetpack-connection-banner.js', JETPACK__PLUGIN_FILE ), |
|
| 145 | array( 'jquery' ), |
|
| 146 | JETPACK__VERSION, |
|
| 147 | true |
|
| 148 | ); |
|
| 149 | ||
| 150 | wp_localize_script( |
|
| 151 | 'jetpack-connection-banner-js', |
|
| 152 | 'jp_banner', |
|
| 153 | array( |
|
| 154 | 'ajax_url' => admin_url( 'admin-ajax.php' ), |
|
| 155 | 'connectionBannerNonce' => wp_create_nonce( 'jp-connection-banner-nonce' ), |
|
| 156 | ) |
|
| 157 | ); |
|
| 158 | } |
|
| 159 | ||
| 160 | /** |
|
| 161 | * Renders the new connection banner as of 4.4.0. |
|
| @@ 203-216 (lines=14) @@ | ||
| 200 | * |
|
| 201 | * @since 5.4 |
|
| 202 | */ |
|
| 203 | function gutenpack_editor_assets_fold() { |
|
| 204 | wp_enqueue_style( |
|
| 205 | 'gutenpack-editor', |
|
| 206 | plugins_url( 'modules/shortcodes/css/gutenpack.css', JETPACK__PLUGIN_FILE ), |
|
| 207 | array( 'wp-edit-blocks' ), |
|
| 208 | JETPACK__VERSION |
|
| 209 | ); |
|
| 210 | wp_enqueue_script( |
|
| 211 | 'gutenpack', |
|
| 212 | plugins_url( 'shortcodes/js/block.js', __FILE__ ), |
|
| 213 | array( 'wp-blocks', 'wp-i18n', 'wp-element', 'underscore' ), |
|
| 214 | JETPACK__VERSION |
|
| 215 | ); |
|
| 216 | } |
|
| 217 | ||
| 218 | /** |
|
| 219 | * Maybe load Gutenberg editor assets. |
|