Exemplo n.º 1
0
function pp_init_with_user()
{
    global $current_user, $pp_current_user, $pp;
    if (empty($pp_current_user) || !defined('INIT_ACTION_DONE_PP')) {
        return;
    }
    // Prevent conflicts with JSON REST API (no filtering support for now)
    if (defined('JSON_API_VERSION') && !defined('PP_FILTER_JSON_REST') && false !== strpos($_SERVER['REQUEST_URI'], apply_filters('json_url_prefix', 'wp-json'))) {
        return;
    }
    require_once dirname(__FILE__) . '/pp_main.php';
    if (empty($pp)) {
        $pp = new PP();
    } else {
        $pp->load_user_config();
    }
    $pp_current_user->retrieve_extra_groups();
    // retrieve BP groups and other group types registered by 3rd party
    pp_supplement_user_allcaps($pp_current_user);
    $current_user->allcaps = array_merge($current_user->allcaps, $pp_current_user->allcaps);
    // copies above changes and any 3rd party filtering
    do_action('pp_user_init');
}
Exemplo n.º 2
0
function pp_init_with_user()
{
    global $current_user, $pp_current_user, $pp;
    if (empty($pp_current_user) || !defined('INIT_ACTION_DONE_PP')) {
        return;
    }
    require_once dirname(__FILE__) . '/pp_main.php';
    if (empty($pp)) {
        $pp = new PP();
    } else {
        $pp->load_user_config();
    }
    $pp_current_user->retrieve_extra_groups();
    // retrieve BP groups and other group types registered by 3rd party
    pp_supplement_user_allcaps($pp_current_user);
    $current_user->allcaps = array_merge($current_user->allcaps, $pp_current_user->allcaps);
    // copies above changes and any 3rd party filtering
    do_action('pp_user_init');
}