Skip to content

Commit

Permalink
Fix enqueueing of custom Prism.js language assets. See #3
Browse files Browse the repository at this point in the history
  • Loading branch information
bradyvercher committed Sep 13, 2018
1 parent 970a3ee commit fb5fc14
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions php/BlockType/Code.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down

0 comments on commit fb5fc14

Please sign in to comment.