Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix update apiVersion of block to version 3 #211

Merged
merged 6 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion block.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title":"Apple Maps",
"category":"embed",
"description":"Add an Apple Map to your site.",
"apiVersion": 2,
"apiVersion": 3,
"keywords":[
"apple",
"map",
Expand Down
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 @@

}

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
Loading