From fb5fc149fb6b262314f3b1664976898316c2dc92 Mon Sep 17 00:00:00 2001 From: Brady Vercher Date: Thu, 13 Sep 2018 14:56:26 -0700 Subject: [PATCH] Fix enqueueing of custom Prism.js language assets. See #3 --- php/BlockType/Code.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/BlockType/Code.php b/php/BlockType/Code.php index b54522b..23d479a 100644 --- a/php/BlockType/Code.php +++ b/php/BlockType/Code.php @@ -91,9 +91,9 @@ protected function enqueue_assets() { wp_enqueue_script( 'prism' ); // @todo Determine which languages are used in a block. - $languages = [ 'css', 'javascript', 'php' ]; - foreach ( $languages as $language ) { - $handle = 'prism-' . $language; + $languages = $this->plugin->get_languages(); + foreach ( $languages as $id => $language ) { + $handle = 'prism-' . $id; if ( wp_script_is( $handle, 'registered' ) ) { wp_enqueue_script( $handle ); }