Skip to content

Commit

Permalink
Load apple-mapkit-js script within the editor iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
wadebekker committed Aug 21, 2024
1 parent e3ef2f6 commit 655f802
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions includes/block-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ function register_block_assets() {

}

add_action( 'enqueue_block_assets', __NAMESPACE__ . '\load_apple_map_script_in_iframe' );
/**
* Load Apple MapKit script within the editor iframe.
* This is required in order to target the correct DOM node within the iframe
* and apply the Mapkit script to it.
*/
function load_apple_map_script_in_iframe() {
if ( !is_admin() ) {

Check failure on line 88 in includes/block-assets.php

View workflow job for this annotation

GitHub Actions / WPCS

Expected 1 space after "!"; 0 found
return;
}

wp_enqueue_script( 'apple-mapkit-js' );
}

add_action( 'init', __NAMESPACE__ . '\set_script_translations' );
/**
* Load translations.
Expand Down

0 comments on commit 655f802

Please sign in to comment.