call function in constructor wordpress add_action code example
Example 1: how to define function in php
<?php
function writeMsg() {
echo "Hello world!";
}
writeMsg(); //call the function
?>
Example 2: how to call a static method in java
class scratch{
public static hey(){
System.out.println("Hey");
}
public static void main(String[] args){
hey();
//print Hey to the console
}