homegrade_theme_production/includes/admin.php

66 lines
1.7 KiB
PHP

<?php
// #### ADMIN STYLE
function my_custom_admin()
{
wp_enqueue_style('admin_styles', get_template_directory_uri() . '/css/admin-style.css');
}
add_action('admin_head', 'my_custom_admin');
// #### ENQUEUE DU COLOR SCHEME ADMIN
function homegrade_admin_color_scheme()
{
//Get the theme directory
$theme_dir = get_stylesheet_directory_uri();
//Homegrade
wp_admin_css_color(
'homegrade_light',
'Homegrade Light',
$theme_dir . '/homegrade-light-color-scheme.css',
array('#cf4944', '#fff', '#d54e21', '#2f0154')
);
wp_admin_css_color(
'homegrade_dark',
'Homegrade Dark',
$theme_dir . '/homegrade-dark-color-scheme.css',
array('#2f2a33', '#fff', '#e14d43', '#e14d43')
);
}
add_action('admin_init', 'homegrade_admin_color_scheme');
// ##### REMOVE FROM ADMIN MENU
function custom_menu_page_removing()
{
// remove_menu_page('edit.php'); // Hide Articles
remove_menu_page('edit-comments.php'); // Hide Commentaires
}
add_action('admin_menu', 'custom_menu_page_removing');
// ##### Removes from admin bar
function mytheme_admin_bar_render()
{
global $wp_admin_bar;
$wp_admin_bar->remove_menu('comments');
}
add_action('wp_before_admin_bar_render', 'mytheme_admin_bar_render');
// ##### MODIFIER LE LIEN DU LOGO SUR LA BLADE DE CONNEXION À L'INTERFACE ADMIN
function change_login_logo_url($url)
{
return site_url();
}
add_filter('login_headerurl', 'change_login_logo_url');
// ##### ENQUEUE DU CSS BLADE LOGIN ADMIN
function enqueue_custom_login_stylesheet()
{
wp_enqueue_style('custom-login', get_stylesheet_directory_uri() . '/style-login.css');
}
add_action('login_enqueue_scripts', 'enqueue_custom_login_stylesheet');