76 lines
2.6 KiB
PHP
76 lines
2.6 KiB
PHP
<?php
|
|
|
|
/* ----------------------------------------------------------------
|
|
##### ENQUEUE 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');
|
|
|
|
/* ----------------------------------------------------------------
|
|
##### 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');
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
PASSER LES COULEURS DU THEMES AU COLOR PICKER ACF
|
|
------------------------------------------------------------------------*/
|
|
function change_acf_input_colors()
|
|
{ ?>
|
|
<script type="text/javascript">
|
|
(function($) {
|
|
acf.add_filter('color_picker_args', function($args, $field) {
|
|
|
|
// this will create a settings variable with all settings
|
|
const $settings = wp.data.select("core/editor").getEditorSettings();
|
|
// pull out the colors from that variable
|
|
let $colors = $settings.colors.map(x => x.color);
|
|
|
|
// assign those colors to palettes
|
|
$args.palettes = $colors;
|
|
return $args;
|
|
});
|
|
})(jQuery);
|
|
</script>
|
|
<?php }
|
|
add_action('acf/input/admin_footer', 'change_acf_input_colors');
|