Support Contact Dashboard Widget
Shows your agency or developer contact details on the dashboard, so clients always know how to reach you.
Opens WPIDE on
Code
$wpide_support = array(
'name' => 'Acme Web Studio',
'email' => '[email protected]',
'phone' => '+1 555 0100',
'url' => 'https://example.com/support',
'hours' => 'Monday to Friday, 9:00 to 17:00',
);
add_action( 'wp_dashboard_setup', function () use ( $wpide_support ) {
wp_add_dashboard_widget( 'wpide_support_contact', 'Need Help?', function () use ( $wpide_support ) {
printf( '<p>Questions about your website? Contact <strong>%s</strong>.</p><ul>', esc_html( $wpide_support['name'] ) );
if ( $wpide_support['email'] ) {
printf( '<li>Email: <a href="mailto:%1$s">%1$s</a></li>', esc_html( antispambot( $wpide_support['email'] ) ) );
}
if ( $wpide_support['phone'] ) {
printf( '<li>Phone: <a href="tel:%1$s">%2$s</a></li>', esc_attr( preg_replace( '/[^0-9+]/', '', $wpide_support['phone'] ) ), esc_html( $wpide_support['phone'] ) );
}
if ( $wpide_support['url'] ) {
printf( '<li><a href="%s" target="_blank" rel="noopener">Open a support request</a></li>', esc_url( $wpide_support['url'] ) );
}
echo '</ul>';
if ( $wpide_support['hours'] ) {
printf( '<p style="color:#646970">%s</p>', esc_html( $wpide_support['hours'] ) );
}
} );
}, 1 );
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.