some more little codes for restrictions and registrations

This commit is contained in:
asus
2024-03-02 21:43:43 +01:00
parent 7738ad1863
commit 8862bab1bd
16 changed files with 312 additions and 131 deletions

View File

@@ -0,0 +1,25 @@
<?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() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
add_action('after_setup_theme', 'hide_admin_bar');
?>