Created
April 10, 2019 08:12
-
-
Save WordPress-Handbuch/00e3baa451bd47dd7d7f7521e8048358 to your computer and use it in GitHub Desktop.
WordPress 5 Hello Word with translations commands
This file contains hidden or 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 | |
/** | |
* @package WH_Hello_World | |
* @version 1.1.0 | |
*/ | |
/* | |
Plugin Name: WH Hello World | |
Plugin URI: https://wordpress-handbuch.com | |
Description: Testausgabe in Front- und Backend | |
Author: Johannes Mustermann | |
Version: 1.1.0 | |
Author URI: https://ihredomain | |
*/ | |
function hello_world_load_textdomain() { | |
load_plugin_textdomain( 'wh-hello-world', false, basename( dirname( __FILE__ ) ) . '/languages' ); | |
} | |
function hello_world() { | |
echo "<script>alert('" . __('Hello World!', 'wh-hello-world') . "');</script>\n"; | |
} | |
add_action( 'admin_head', 'hello_world' ); | |
add_action( 'wp_head', 'hello_world' ); | |
add_action( 'init', 'hello_world_load_textdomain' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment