Skip to content
Home » Hello world from another WordPress Plugin

Hello world from another WordPress Plugin

Welcome to WordPress. From a new plugin you can print hello world like this.

First of all, call an action within a Global Request method as follows:

# ../wp-content/plugins/MyPlugin/myplugin.php
if (isset($_REQUEST['test']) && $_REQUEST['test'] == 'a') {
	 add_action('init', function () {
		 echo 'Hello World';
		 echo '<br>';
		 echo 'Hello from WordPress';
		 echo '<br>';
		 die();
	 });
}

Now run the code.

Go to your site url like

http://wordpress.local/?test=a

Enjoy the output!

4 thoughts on “Hello world from another WordPress Plugin”

Leave a Reply

Your email address will not be published. Required fields are marked *