Created
September 14, 2023 12:08
-
-
Save itthinx/4bf31fcad81fb1115ac69ce6fbf72b59 to your computer and use it in GitHub Desktop.
I am a minimalist plugin which logs 'I am Foo!' when the plugins_loaded action fires.
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 | |
/** | |
* Plugin Name: Foo | |
* Description: I am a minimalist plugin which logs 'I am Foo!' when the plugins_loaded action fires. | |
*/ | |
if ( !defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** | |
* Hooked on the plugins_loaded action. | |
*/ | |
function foo_plugins_loaded() { | |
error_log( 'I am Foo!' ); | |
} | |
add_action( 'plugins_loaded', 'foo_plugins_loaded' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code example for https://www.reddit.com/r/Wordpress/comments/16id6gu/comment/k0jfpy6/