Created
March 22, 2022 05:08
-
-
Save marcusig/e8d5e52304e1b4ac0d6626ea0ed5f8da to your computer and use it in GitHub Desktop.
Add a script after initialising / starting the configurator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp.hooks.addAction( 'PC.fe.start', 'Custom_script', function( configurator ) { | |
// Do something here. E.g.: | |
// Get the viewer | |
var viewer = configurator.viewer.$el; | |
// Get the layer container | |
var layers_container = configurator.viewer.$( '.mkl_pc_layers' ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script can be added using an external file, like this:
It can also be added inline using
wp_add_inline_script
, as done in some of the themes.