AI Verified

Name

Company Screen Option

About

Add your Logo and Company Details to the WordPress Dashboard as a Screen Option

Language

PHP

Rating

Voted: 2 by 2 user(s)

Codevault

WebSquadron

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.

History

Last modified:

19/02/2024

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 Screen Option

 
                    
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});

2

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

AI Verified

0

Redirect user role on specific page

Added: 1 year ago

Last Updated: 1 year ago

This code will redirect a specific page based on the user role NOT being met.

WordPress Admin

AI Verified

1

Disable all update notifications emails

Added: 1 year ago

Last Updated: 1 year ago

WordPress Admin

AI Verified

1

Save in WP Admin with CTRL + S

Added: 1 year ago

Last Updated: 1 month ago

Save time by hitting CTRL/CMD + S instead of scrolling to find the Save/Update/Publish button

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

Performance

AI Verified

31

Remove Unused Javascript

Added: 1 year ago

Last Updated: 1 month ago

Remove Unused Javascript - and improve your Page Speed Insight Score

WooCommerce

Pro Verified

10

Deactivate some WooCommerce Checkout Fields

Added: 1 year ago

Last Updated: 4 days ago

Deactivate some WooCommerce Checkout Fields from showing

Elementor

AI Verified

6

CSS Grid Aid

Added: 7 months ago

Last Updated: 1 month ago

This can be used for any WordPress Builder to aid working with CSS Grids.