Files
2024_WEBSITE_fipf/plugins/cipf_plugin/php/hide_admin.php
asus 0127d8db4c - most prof states shoud be ok
- redirection partner page creation
- user ids on checks states
- reset cgv
- restrict prof profil page
2024-03-20 00:26:39 +01:00

44 lines
586 B
PHP

<?php
/*
* it means someone outside wp is accessing the file, in this case kill it.
*/
if (!defined('ABSPATH')) {
die('You can not access this file!');
}
/*
* hide admin bar if access a front page and is not an admin
*/
function hide_admin_bar_CIPF() {
PLGNTLS_class::debug_infos();
$role_admin = PLGNTLS_class::ROLE_ADMIN;
$role_fipf = PLGNTLS_class::ROLE_FIPF;
/*
* is admin page
*
*/
if (is_admin()) {
return;
}
/*
* if
*
*/
if (!current_user_can($role_admin)) {
show_admin_bar(false);
}
}
add_action('after_setup_theme', 'hide_admin_bar_CIPF');
?>