PluginProbe
Parse.ly / 3.2.0
Parse.ly v3.2.0
3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 3.20.2 3.20.3 All 105 releases
wp-parsely / src / js / lib / loader.js

loader.js in Parse.ly 3.2.0, at src/js/lib/loader.js

35 lines 896 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { createHooks } from '@wordpress/hooks';
2
3 window.wpParselyHooks = createHooks();
4
5 export function wpParselyInitCustom() {
6 /**
7 * The `wpParselyOnLoad` hook gets called with the `onLoad` event of the `window.PARSELY` object.
8 * All functions enqueued on that hook will be executed on that event according to their priorities. Those
9 * functions should not expect any parameters and shouldn't return any.
10 */
11 const customOnLoad = () => window.wpParselyHooks.doAction( 'wpParselyOnLoad' );
12
13 if ( typeof window.PARSELY === 'object' ) {
14 if ( typeof window.PARSELY.onload !== 'function' ) {
15 window.PARSELY.onload = customOnLoad;
16 return;
17 }
18
19 const oldOnLoad = window.PARSELY.onload;
20 window.PARSELY.onload = function() {
21 if ( oldOnLoad ) {
22 oldOnLoad();
23 }
24 customOnLoad();
25 };
26 return;
27 }
28
29 window.PARSELY = {
30 onload: customOnLoad,
31 };
32 }
33
34 wpParselyInitCustom();
35