Custom Dashboard Welcome Widget
Adds a Dashboard widget with your own message, such as instructions for clients or contact details for support.
Opens WPIDE on
Code
add_action( 'wp_dashboard_setup', function () {
wp_add_dashboard_widget( 'wpide_welcome_widget', 'Welcome', function () {
$email = (string) get_option( 'admin_email' );
echo '<p>Welcome to your website dashboard. Use the menu on the left to add pages, write posts and upload media.</p>';
echo '<p>Questions? Email <a href="mailto:' . esc_attr( $email ) . '">' . esc_html( $email ) . '</a>.</p>';
} );
} );
Notes
Edit the widget title and the two paragraphs.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.