Last active
December 1, 2025 20:47
-
-
Save nathaningram/82bc72e71ca0888660ed311230675f0f to your computer and use it in GitHub Desktop.
Starter Site 2025 - MU Dashboard Widgets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Custom Dashboard Widgets | |
| Plugin URI: https://wpnathan.com | |
| Description: Creates Custom Dashboard Widgets for Client Websites | |
| Version: 1.0 | |
| Author: Nathan Ingram | |
| Author URI: https://wpnathan.com | |
| License: GPL2 | |
| */ | |
| // Security Check | |
| if (!defined('ABSPATH')) { | |
| die(); | |
| } | |
| // Create Custom Client Dashboard Widget | |
| add_action('wp_dashboard_setup', 'ni_custom_dashboard_widget'); | |
| function ni_custom_dashboard_widget() { | |
| global $wp_meta_boxes; | |
| wp_add_dashboard_widget('ni_client_widget', 'WP Nathan Clients', 'ni_client_widget_content'); | |
| } | |
| function ni_client_widget_content() { | |
| $url = get_site_url(); | |
| echo '<p style="text-align:center"> | |
| <img src="//wpnathan.com/wp-content/uploads/2025/04/cropped-Untitled.jpeg" /> | |
| </p> | |
| <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; margin: 1.5em 0;"> | |
| <a style="padding: 10px; background: #0073aa; color: white; text-decoration: none; display: inline-block; border-radius: 3px;" class="button" href="#" target="_blank" rel="noopener noreferrer">Google Analytics Instructions</a> | |
| <a style="padding: 10px; background: #0073aa; color: white; text-decoration: none; display: inline-block; border-radius: 3px;" class="button" href="#">WordPress Help Videos</a> | |
| <a style="padding: 10px; background: #0073aa; color: white; text-decoration: none; display: inline-block; border-radius: 3px;" class="button" href="#">WordPress Manual</a> | |
| <a style="padding: 10px; background: #0073aa; color: white; text-decoration: none; display: inline-block; border-radius: 3px;" class="button" href="mailto:[email protected]?Subject=BRIEFLY DESCRIBE YOUR ISSUE&body=Change the subject line above to a summary of your issue, then provide more detail here.">Create a Support Ticket</a> | |
| </div>'; | |
| } | |
| //Add a Support Form Widget | |
| function ni_register_custom_dashboard_support_widget() { | |
| wp_add_dashboard_widget( | |
| 'custom_dashboard_widget', | |
| 'Support Request Form', //Title for Dashboard Widget | |
| 'ni_custom_dashboard_support_widget_content' | |
| ); | |
| } | |
| function ni_custom_dashboard_support_widget_content() { | |
| echo do_shortcode('[gravityform id="1" title="false" description="false" ajax="true"]'); | |
| //Add your form shortcode above or replace Gravity Form ID with your own | |
| } | |
| add_action( 'wp_dashboard_setup', 'ni_register_custom_dashboard_support_widget' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment