PHP code example of hyyan / dashboard

1. Go to this page and download the library: Download hyyan/dashboard library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hyyan / dashboard example snippets


$default = array(
    // dashboard title
    'title' => __('Dashboard'),
    // dashboard heading
    'heading' => __('Dashboard'),
    // welcome panel file
    'welcome-panel' => '/welcome-panel.php',
    // array of dashboardd metaboxes to remove
    'remove-metaboxes' => array(
        'dashboard_plugins' => true,
        'dashboard_primary' => true,
        'dashboard_secondary' => true,
        'dashboard_incoming_links' => true,
        'dashboard_quick_press' => false,
        'dashboard_recent_drafts' => false,
        'custom_help_widget' => false,
        'welcome_panel' => false,
    ),
    // diable the ability to switch themes 
    'disable-theme-switch' => true,
    // replace wordpress version
    'version' => '',
    // replace wordpress copyright
    'copyright' => '',
    // adminbar menus to remove
    'remove-adminbar-menus' => array(
        'wp-logo',
        'about',
        'wporg',
        'documentation',
        'support-forums',
        'feedback',
        'updates',
        'themes'
    ),
    // menu pages to remove
    'remove-menus' => array()
);

// in the your theme's functions.php file

add_filter('Hyyan\Dashboard.options', function($default) {

    $default['title'] = 'This is a test';
    $default['heading'] = 'This is heading';
    $default['remove-metaboxes'] = array_merge($default['remove-metaboxes'], array(
        'dashboard_quick_press' => false
    ));

    return $default;
});