AI Verified

Name

Company Details

Language

PHP

Rating

Voted: 0 by 0 user(s)

Codevault

Pixel

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.4

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.

History

Last modified:

21/12/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 = '[email protected]'; // 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

Remove WordPress Version Number

Added: 1 year ago

Last Updated: 1 year ago

Removes wordpress version that is present

WordPress Admin

Unverified

0

Clamp

Added: 10 months ago

Last Updated: 10 months ago

Fluid Typography Code Snippet - Add the Tool to your Dashboard or Page

WordPress Admin

AI Verified

0

Remove unwanted dashboard widgets

Added: 1 year ago

Last Updated: 1 year ago

This snippet removes unnecessary widgets from the WordPress dashboard, keeping it clean and uncluttered.

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WordPress Admin

AI Verified

0

Company Details

Added: 8 months ago

Last Updated: 8 months ago