Пример #1
0
 function admin_page_handler()
 {
     if (!is_user_logged_in()) {
         sprintf('Please <a href="%s">login</a>', wp_login_url());
         return;
     }
     $current_user_id = get_current_user_id();
     $user_status = get_user_meta($current_user_id, '_status', true);
     if ($user_status == 'no') {
         _e('<div class="hrm wrap"><h1>This account temporary disabled!</h1></div>', 'hrm');
         return;
     }
     $menu = hrm_page();
     $query_args = hrm_get_query_args();
     $page = $query_args['page'];
     $tab = $query_args['tab'];
     $subtab = $query_args['subtab'];
     if ($page == 'hrm_author') {
         require_once dirname(__FILE__) . '/templates/author/header.php';
         return;
     }
     echo '<div class="hrm wrap" id="hrm">';
     Hrm_Settings::getInstance()->show_tab_page($page, $tab, $subtab);
     echo '</div>';
 }
function hrm_get_employee_id()
{
    $query = hrm_get_query_args();
    $menu = hrm_page();
    $page = $query['page'];
    $tab = $query['tab'];
    if (!isset($menu[$page][$tab]['nested_tab'])) {
        return false;
    }
    if (!$menu[$page][$tab]['nested_tab']) {
        return false;
    }
    $employee_id = !empty($_GET['employee_id']) ? intval($_GET['employee_id']) : false;
    return $employee_id;
}