diff options
author | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-02-18 20:08:35 +0100 |
---|---|---|
committer | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-02-18 20:08:35 +0100 |
commit | bb7b1958b1171567694218378968fe42e43b1294 (patch) | |
tree | 5f6b30bc81464440021bfcbd411a65650eea91bc /giglogadmin.php | |
parent | 56bff8bbb0f5d0edd9851f06ec91bacd0365e87e (diff) | |
download | gigologadmin-bb7b1958b1171567694218378968fe42e43b1294.tar.gz gigologadmin-bb7b1958b1171567694218378968fe42e43b1294.tar.bz2 gigologadmin-bb7b1958b1171567694218378968fe42e43b1294.zip |
Added function to display different menus for logged and not logged users
Diffstat (limited to 'giglogadmin.php')
-rw-r--r-- | giglogadmin.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/giglogadmin.php b/giglogadmin.php index c627ad8..0611758 100644 --- a/giglogadmin.php +++ b/giglogadmin.php @@ -16,6 +16,20 @@ * License: AGPLv3 * License URI: https://www.gnu.org/licenses/agpl-3.0.txthttps://www.gnu.org/licenses/agpl-3.0.txt */ + + //function to show menus based on whether user is logged in or not. Giglog admin pages should only be visible for logged in users/can eventually be customized by role if needed + +function my_wp_nav_menu_args( $args = '' ) { + +if( is_user_logged_in() ) { + $args['menu'] = 'Loggedusers'; +} else { + $args['menu'] = 'Notloggedusers'; +} + return $args; +} +add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' ); + if ( !class_exists( 'GiglogAdmin_Plugin' ) ) { require_once __DIR__ . '/includes/public/shortcodes/giglog_bands.php'; |