Skip to content

Commit

Permalink
Audit usage of block extensions when blocks disabled (#39070)
Browse files Browse the repository at this point in the history
* Check map_block_from_geo_points function exists, and require the file if it doesn't

* changelog

---------

Co-authored-by: Karen Attfield <[email protected]>
  • Loading branch information
2 people authored and gogdzl committed Oct 25, 2024
1 parent 91ab0b3 commit fa23ad6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

Blocks: Ensure function is loaded even if blocks aren't enabled
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,9 @@ private function dtp_fb_preprocess_post( $post, $metadata ) {
'title' => $fb_point['name'],
);
}
if ( ! function_exists( 'map_block_from_geo_points' ) ) {
require_once JETPACK__PLUGIN_DIR . 'extensions/blocks/map/map.php';
}
$map_block = map_block_from_geo_points( $geo_points );

$post['post_content'] = $map_block . $post['post_content'];
Expand Down

0 comments on commit fa23ad6

Please sign in to comment.