/** * Prints a script that creates lockers. * * @since 1.0.0 * @return void */ public static function printLockerCreatorScript() { do_action('opanda_before_locker_creator_script'); $args = array(); $args[opanda_get_robust_key()] = opanda_get_robust_script_key(); $robustLoader = add_query_arg($args, site_url()); ?> <!-- Lockers: script checks if the locker assets were successfully loaded and creates lockers. OnePress, bizpanda.com --> <script> (function($){ if ( window.bizpanda && window.bizpanda.initLockers ) { window.bizpanda.initLockers(); } })(jQuery); (function($){ $(function(){ if ( window.bizpanda && window.bizpanda.initLockers ) return; $.getScript( "<?php echo $robustLoader; ?> ", function() { if ( window.bizpanda && window.bizpanda.initLockers ) window.bizpanda.initLockers(); }); }); })(jQuery); </script> <?php do_action('opanda_after_locker_creator_script'); }
/** * Handles a frontend action linked with bizpanda. * * @since 1.1.0 * @return void */ function bizpanda_frontend_action() { $robustKey = opanda_get_robust_key(); if (isset($_REQUEST['bizpanda'])) { $action = $_REQUEST['bizpanda']; if ('terms-of-use' === $action) { return bizpanda_show_terms_of_use(); } if ('privacy-policy' === $action) { return bizpanda_show_privacy_policy(); } } else { if (isset($_REQUEST[$robustKey])) { $action = $_REQUEST[$robustKey]; if (opanda_get_robust_script_key() === $action) { echo file_get_contents(OPANDA_BIZPANDA_DIR . '/assets/js/lockers.010101.min.js'); exit; } } } }