base === 'dashboard') { $dismissed = isset($_COOKIE['pp_dashboard_welcome_dismissed']); if (!$dismissed) { ?>

Welcome to My Custom Dashboard!

This is a customized message for the dashboard.

Contact Support

  • Your Address
  • Your Email
  • Your Phone Number
base === 'dashboard') { $dismissed = isset($_COOKIE['pp_dashboard_welcome_dismissed']); if (!$dismissed) { wp_enqueue_script('pp-welcome-dismiss', get_template_directory_uri() . '/js/welcome-dismiss.js', array(), '1.0', true); } } } add_action('admin_enqueue_scripts', 'pp_admin_enqueue_scripts'); /////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////// Output custom CSS styles /////////////////////////////////////////////////////////////////////////////////////////////////////////// // function palettepro_output_styles() { include 'palettepro_output_styles.php'; } add_action('admin_head', 'palettepro_output_styles'); add_action('login_head', 'palettepro_output_styles'); /////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////// Create the color customizer page /////////////////////////////////////////////////////////////////////////////////////////////////////////// function palettepro_page() { // Handle form submission if (isset($_POST['submit'])) { // Validate and save the selected colors and border radius /////////////////////////////////// DASHBOARD ////////////////////////////////////////////// $dashboard_background_color = sanitize_hex_color($_POST['dashboard_background_color']); $border_radius = absint($_POST['border_radius']); /////////////////////////////////// LEFT MENU ////////////////////////////////////////////// $left_menu_bg_color = sanitize_hex_color($_POST['left_menu_bg_color']); $left_menu_bg_items = sanitize_hex_color($_POST['left_menu_bg_items']); $left_menu_item_text_color = sanitize_hex_color($_POST['left_menu_item_text_color']); $left_menu_item_bg_color = sanitize_hex_color($_POST['left_menu_item_bg_color']); $left_menu_item_bg_hover = sanitize_hex_color($_POST['left_menu_item_bg_hover']); $left_menu_item_text_hover = sanitize_hex_color($_POST['left_menu_item_text_hover']); /////////////////////////////////// TOP MENU ////////////////////////////////////////////// $top_menu_bg_color = sanitize_hex_color($_POST['top_menu_bg_color']); $logo_file = $_FILES['logo_file']; if ($logo_file['error'] === UPLOAD_ERR_OK) { // Upload the dashboard logo $upload_dir = wp_upload_dir(); $logo_dir = trailingslashit($upload_dir['basedir']) . 'palettepro-logos/'; $logo_url = trailingslashit($upload_dir['baseurl']) . 'palettepro-logos/'; // Create the directory if it doesn't exist if (!file_exists($logo_dir)) { mkdir($logo_dir); } $logo_filename = $logo_file['name']; $logo_path = $logo_dir . $logo_filename; move_uploaded_file($logo_file['tmp_name'], $logo_path); update_option('palettepro_logo_url', $logo_url . $logo_filename); } /////////////////////////////////// LOGIN PAGE ////////////////////////////////////////////// $login_bg_type = $_POST['login_bg_type']; $login_bg_color = sanitize_hex_color($_POST['login_bg_color']); $login_bg_gradient_start = sanitize_hex_color($_POST['login_bg_gradient_start']); $login_bg_gradient_end = sanitize_hex_color($_POST['login_bg_gradient_end']); $login_logo_file = $_FILES['login_logo_file']; if ($login_logo_file['error'] === UPLOAD_ERR_OK) { // Upload the login page logo $upload_dir = wp_upload_dir(); $logo_dir = trailingslashit($upload_dir['basedir']) . 'palettepro-logos/'; $logo_url = trailingslashit($upload_dir['baseurl']) . 'palettepro-logos/'; // Create the directory if it doesn't exist if (!file_exists($logo_dir)) { mkdir($logo_dir); } $logo_filename = $login_logo_file['name']; $logo_path = $logo_dir . $logo_filename; // Move the uploaded file to the designated directory move_uploaded_file($login_logo_file['tmp_name'], $logo_path); // Update the login page logo URL option update_option('palettepro_login_logo_url', $logo_url . $logo_filename); } /////////////////////////////////// BUTTONS ////////////////////////////////////////////// $primary_button_bg_color = sanitize_hex_color($_POST['primary_button_bg_color']); $primary_button_hover_color = sanitize_hex_color($_POST['primary_button_hover_color']); $secondary_button_bg_color = sanitize_hex_color($_POST['secondary_button_bg_color']); $secondary_button_hover_color = sanitize_hex_color($_POST['secondary_button_hover_color']); $primary_color = sanitize_hex_color($_POST['primary_color']); update_option('palettepro_dashboard_background_color', $dashboard_background_color); update_option('palettepro_border_radius', $border_radius); update_option('palettepro_top_menu_bg_color', $top_menu_bg_color); update_option('palettepro_login_bg_type', $login_bg_type); update_option('palettepro_login_bg_color', $login_bg_color); update_option('palettepro_login_bg_gradient_start', $login_bg_gradient_start); update_option('palettepro_login_bg_gradient_end', $login_bg_gradient_end); update_option('palettepro_primary_button_bg_color', $primary_button_bg_color); update_option('palettepro_primary_button_hover_color', $primary_button_hover_color); update_option('palettepro_secondary_button_bg_color', $secondary_button_bg_color); update_option('palettepro_secondary_button_hover_color', $secondary_button_hover_color); update_option('palettepro_primary_color', $primary_color); update_option('palettepro_left_menu_bg_color', $left_menu_bg_color); update_option('palettepro_left_menu_bg_items', $left_menu_bg_items); update_option('palettepro_left_menu_item_text_color', $left_menu_item_text_color); update_option('palettepro_left_menu_item_bg_color', $left_menu_item_bg_color); update_option('palettepro_left_menu_item_bg_hover', $left_menu_item_bg_hover); update_option('palettepro_left_menu_item_text_hover', $left_menu_item_text_hover); // Show the loader echo '
'; // Refresh the page after a delay echo ''; // .................................. // .................................. } elseif (isset($_POST['reset'])) { echo '
'; // Code to reset the options to their default values... reset_palettepro_options(); // Refresh the page after resetting echo ''; } /////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////// Retrieve the previously selected colors and border radius /////////////////////////////////////////////////////////////////////////////////////////////////////////// $dashboard_background_color = get_option('palettepro_dashboard_background_color', '#81d742'); $border_radius = get_option('palettepro_border_radius', 0); $logo_url = get_option('palettepro_logo_url'); $top_menu_bg_color = get_option('palettepro_top_menu_bg_color', 'red'); $login_bg_type = get_option('palettepro_login_bg_type', 'color'); $login_bg_color = get_option('palettepro_login_bg_color', '#ffffff'); $login_bg_gradient_start = get_option('palettepro_login_bg_gradient_start', '#ffffff'); $login_bg_gradient_end = get_option('palettepro_login_bg_gradient_end', '#ffffff'); $login_logo_url = get_option('palettepro_login_logo_url'); $primary_color = get_option('palettepro_primary_color', '#000000'); $primary_button_bg_color = get_option('palettepro_primary_button_bg_color', '#007cba'); $secondary_button_bg_color = get_option('palettepro_secondary_button_bg_color', '#999999'); $primary_button_hover_color = get_option('palettepro_primary_button_hover_color', '#005a8c'); $secondary_button_hover_color = get_option('palettepro_secondary_button_hover_color', '#808080'); $left_menu_bg_color = get_option('palettepro_left_menu_bg_color', 'yellow'); $left_menu_bg_items = get_option('palettepro_left_menu_bg_items', 'yellow'); $left_menu_item_text_color = get_option('palettepro_left_menu_item_text_color', 'yellow'); $left_menu_item_bg_color = get_option('palettepro_left_menu_item_bg_color', 'yellow'); $left_menu_item_bg_hover = get_option('palettepro_left_menu_item_bg_hover', 'yellow'); $left_menu_item_text_hover = get_option('palettepro_left_menu_item_text_hover', 'yellow'); ?>

PalettePro

BETA

Unlock the Power of Customization with PalettePro: Transform Your WordPress Experience with Personalized Colors and Styling!

Lorem ipsum dolor sit amet consectetur adipisicing elit.

quam, aliquid eos voluptatibus iure minus maiores, quos nisi dolorum harum est excepturi impedit magni distinctio vero libero ipsa! Aperiam.

'; echo ' palettePro ' . $plugin_version . ' '; echo '

'; ?> General Left Menu Top Menu Buttons Reset Settings

Control Panel Customization

Login Customization

Login Page Logo

Left Menu Styling

Background

TEXT

Top Menu Enhancement

Logo

Button Customization

RESET

' . __('Upgrade', 'your-text-domain') . ''; $action_links = array( 'upgrade' => $upgrade_link, 'settings' => '' . __('Settings', 'your-text-domain') . '', 'deactivate' => '' . __('Deactivate', 'your-text-domain') . '', ); return array_merge($action_links, $links); } // Add the action links to the plugin row add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'pp_custom_links_plugin_page'); /////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add the color customizer page to the admin menu function palettepro_menu() { add_menu_page( 'PalettePro', // Page title 'PalettePro', // Menu title 'manage_options', // Capability required to access the menu item 'palettepro', // Menu slug 'palettepro_page', // Callback function to render the page 'dashicons-art', // Icon name (using 'art' icon) 1 // Position in the menu ); } add_action('admin_menu', 'palettepro_menu');