Am I using add_action('init'
correctly?
I want to display some data if a user visits example.com/?my_plugin
At the moment I'm using...
<?php
add_action( 'init', 'my_plugin' );
function my_plugin()
{
if( isset( $_GET['my_plugin'] ) ) {
...
echo $data;
}
}
This will run every time any page on the blog is loaded, as I understand it. Does that present a performance issue?
Is there a better way I could accomplish this?