My second WP plugin 0 ▲ Revfad Blog 186 days ago · Tech · hide · Fediverse post I’m starting to read “WordPress Plugin Development Cookbook – Third Edition”. The first example does nothing other than make a do nothing plugin visible in the admin page, but the second example already allowed for some fun. I’m happy with how psychedelic this turned out: <?php /* Plugin Name: Chapter 2 - Plugin Page Header Plugin URI: Description: Declares a plugin that will add something to the header Version: 1.0 Author: David Faden Author URI: https://revfad.com License: MIT */ add_action('wp_head', 'ch2pho_page_header_output'); function ch2pho_page_header_output() { ?> <script> function setRandomBgcolor() { if (!document.body?.style) { return; } const color = '#' + parseInt(0xffffff * Math.random()).toString(16).padStart('0', 6); document.body.style.backgroundColor = color; } setInterval(setRandomBgcolor, 300); </script> <?php } I won’t add it here though. References mentioned: https://codex.wordpress.org/Main_Page https://developer.wordpress.org/apis/hooks/action-reference/… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town