Skip to content

Commit

Permalink
Merge pull request #255 from boxuk/fix/iconography/prevent-unnecessar…
Browse files Browse the repository at this point in the history
…y-js-loading

[FIX] Prevent unneceassary JS loading in the frontend
  • Loading branch information
jdamner authored Dec 3, 2024
2 parents e463ee6 + c5e5f1e commit c8d82f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/iconography/includes/IconographyService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function init(): void {
add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ) );
add_action( 'wp_footer', array( $this, 'enqueue_assets' ), 1, 0 );
add_action( 'enqueue_block_assets', array( $this, 'register_assets' ), 1, 0 );
add_action( 'enqueue_block_assets', array( $this, 'enqueue_editor_scripts' ) );
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_editor_scripts' ) );
add_action( 'enqueue_block_assets', array( $this, 'enqueue_all_assets' ) );
}

Expand Down
2 changes: 1 addition & 1 deletion packages/iconography/tests/TestIcononographyService.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testInit(): void {
\WP_Mock::expectActionAdded( 'wp_enqueue_scripts', array( $class_in_test, 'register_assets' ) );
\WP_Mock::expectActionAdded( 'wp_footer', array( $class_in_test, 'enqueue_assets' ), 1, 0 );
\WP_Mock::expectActionAdded( 'enqueue_block_assets', array( $class_in_test, 'register_assets' ), 1, 0 );
\WP_Mock::expectActionAdded( 'enqueue_block_assets', array( $class_in_test, 'enqueue_editor_scripts' ) );
\WP_Mock::expectActionAdded( 'enqueue_block_editor_assets', array( $class_in_test, 'enqueue_editor_scripts' ) );
\WP_Mock::expectActionAdded( 'enqueue_block_assets', array( $class_in_test, 'enqueue_all_assets' ) );

$class_in_test->init();
Expand Down

0 comments on commit c8d82f0

Please sign in to comment.