AI Verified

Name

Company Details

About

Custom Dashboard Widget for WordPress Admin

Language

PHP

Rating

Voted: 0 by 0 user(s)

How to Setup Snippet

1. Replace the placeholder values in the variables below with your company information. 2. Add this code to your theme's functions.php file or a custom plugin.

Link for further information:

The author has provided the following URL that may be helpful to setting up or using this snippet:

https://www.youtube.com/watch?v=AiJTxkRN5eo

Codevault

duke_flambo

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Snippet Source:

https://websquadron.co.uk/company-details-wordpress-dashboard/

History

Last modified:

16/11/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Company Details

 
                    
1/**
2 * Custom Dashboard Widget for WordPress Admin
3 *
4 * Instructions:
5 * 1. Replace the placeholder values in the variables below with your company information.
6 * 2. Add this code to your theme's functions.php file or a custom plugin.
7 */
8 
9// Customize these variables with your company's information
10$company_name = 'Your Company Name'; // Replace with your company name
11$company_url = 'https://www.yourcompanywebsite.com'; // Replace with your company website URL
12$company_email = 'contact@yourcompanywebsite.com'; // Replace with your company email
13$company_phone = '+1 234 567 8900'; // Replace with your company phone number
14$logo_url = 'https://website.websquadron.co.uk/wp-content/uploads/BlackText-Logo.webp'; // Replace with the direct URL to your logo image
15$background_color = '#FFFFFF'; // Replace with hex color code for background
16$text_color = '#222222'; // Replace with hex color code for text
17$link_color = '#FF0050'; // Replace with hex color code for links
18 
19add_action('wp_dashboard_setup', function() use ($company_name, $company_url, $company_email, $company_phone, $logo_url, $background_color, $text_color, $link_color) {
20 wp_add_dashboard_widget(
21 'custom_dashboard_widget',
22 $company_name,
23 function() use ($company_name, $company_url, $company_email, $company_phone, $logo_url, $background_color, $text_color, $link_color) {
24 ?>
25 <div style="padding: 20px; text-align: center; background-color: <?php echo $background_color; ?>; color: <?php echo $text_color; ?>; border: 1px solid #ddd; box-shadow: 0 1px 4px rgba(0,0,0,0.1);">
26 <img src="<?php echo $logo_url; ?>" alt="<?php echo $company_name; ?> Logo" style="max-width: 100%; height: auto; margin-bottom: 20px;">
27 <h2 style="font-size: 24px; margin-bottom: 15px;"><?php echo $company_name; ?></h2>
28 <p style="font-size: 16px; margin-bottom: 10px;"><a href="<?php echo $company_url; ?>" target="_blank" style="text-decoration: none; color: <?php echo $link_color; ?>;"><?php echo $company_url; ?></a></p>
29 <p style="font-size: 16px; margin-bottom: 10px;">Email: <a href="mailto:<?php echo $company_email; ?>" style="text-decoration: none; color: <?php echo $link_color; ?>;"><?php echo $company_email; ?></a></p>
30 <p style="font-size: 16px;">Telephone: <a href="tel:<?php echo $company_phone; ?>" style="text-decoration: none; color: <?php echo $link_color; ?>;"><?php echo $company_phone; ?></a></p>
31 </div>
32 <?php
33 }
34 );
35});

0

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

AI Verified

0

Replace the 'Howdy' message on the Admin Bar.

Added: 5 months ago

Last Updated: 5 months ago

Replace the 'Howdy' message on the Admin Bar.

WordPress Admin

AI Verified

2

Disable WordPress Comments

Added: 5 months ago

Last Updated: 2 months ago

Remove Comments from Posts and Pages.

WordPress Admin

AI Verified

0

Hide Comments on WP Dashboard

Added: 1 year ago

Last Updated: 1 year ago

Completely hide the comments function in the Wordpress Dashboard

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WordPress Admin

AI Verified

2

Convert Uploaded Images to WebP Format

Added: 7 months ago

Last Updated: 3 days ago

This snippet converts uploaded images (JPEG, PNG, GIF) to WebP format * automatically in WordPress. Ideal for use in a theme's functions.php file, * or with plugins like Code Snippets or WPCodeBox...

General

AI Verified

1

Remove WP media images from being created for no reason

Added: 6 months ago

Last Updated: 1 day ago

WordPress Admin

AI Verified

0

Company Details

Added: 7 months ago

Last Updated: 7 months ago

Custom Dashboard Widget for WordPress Admin