Actually there is..
I’m using another plugin called if menu where other people has done this function that adds to the theme function file.
Could this be helpful?
add_filter( 'if_menu_conditions', 'my_new_menu_conditions' );
function my_new_menu_conditions( $conditions ) {
if (function_exists("EWD_FEUP_Get_All_Users")) {
$conditions[] = array(
'name' => __( 'FEUP is logged in', 'if-menu' ),
'condition' => 'if_FEUP_is_logged_in'
);
}
if (function_exists("EWD_FEUP_Get_All_Users")) {
$conditions[] = array(
'name' => __( 'FEUP Level 1', 'if-menu' ),
'condition' => 'if_FEUP_Level_1'
);
}
return $conditions;
}
function if_FEUP_is_logged_in() {
$CheckCookie = CheckLoginCookie();
$currentUser = $CheckCookie['Username'];
if( $currentUser ) return true;
return false;
}
function if_FEUP_Level_1() {
global $wpdb;
global $ewd_feup_user_table_name, $ewd_feup_levels_table_name;
$FEUP = new FEUP_User;
if($FEUP->Is_Logged_In()){
$Level_ID = $wpdb->get_var("SELECT Level_ID FROM $ewd_feup_user_table_name WHERE User_ID='" . $FEUP->Get_User_ID() . "'");
$Level = $wpdb->get_var("SELECT Level_Privilege FROM $ewd_feup_levels_table_name WHERE Level_ID='" . $Level_ID . "'");
}
if( $Level == 1 ) return true;
return false;
}