__( 'A custom widget for displaying a message.', 'text_domain' ), ) // Args ); } // Widget Frontend public function widget( $args, $instance ) { echo $args['before_widget']; echo '
'; echo '

Hello, World!

'; echo '
'; echo $args['after_widget']; } } // Register the widget function register_my_custom_widget() { register_widget( 'My_Custom_Widget' ); } add_action( 'widgets_init', 'register_my_custom_widget' );