Hello World Dashboard Widget
class Hello_World_Dashboard_Widget { public function __construct() { add_action( 'wp_dashboard_setup', array( $this, 'add_dashboard_widget' ) ); } public function add_dashboard_widget() { wp_add_dashboard_widget( 'hello_world_widget', __( 'Hello World', 'text_domain' ), array( $this, 'render_dashboard_widget' ) ); } public function render_dashboard_widget() { echo "Hello World..."; } } new Hello_World_Dashboard_Widget;