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
let subscribers = {}; | |
module.exports = { | |
publish(event, data) { | |
if (!subscribers[event]) return; | |
subscribers.forEach(callback => { | |
callback(data); | |
}) | |
}, |
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
<?php | |
/* | |
* Add this code to your theme's functions.php file | |
*/ | |
// Theme activation | |
add_action("after_switch_theme", "theme_activated"); | |
function theme_activation_hook(){ | |
error_log('theme activated'); | |
} |