Exemplo n.º 1
0
function rpx_configured()
{
    rpx_bootstrap();
    $required_options = array(RPX_API_KEY_OPTION => 'apiKey', RPX_REALM_OPTION => 'realm', RPX_REALM_SCHEME => 'realmScheme', RPX_ADMIN_URL_OPTION => 'adminUrl');
    foreach ($required_options as $key => $val) {
        $option = get_option($key);
        if (empty($option) || $option === false) {
            return false;
        }
    }
    return true;
}
Exemplo n.º 2
0
function rpx_init()
{
    rpx_bootstrap();
    if (rpx_configured()) {
        if (!function_exists('email_exists') || !function_exists('username_exists')) {
            require_once ABSPATH . WPINC . '/registration.php';
        }
        global $rpx_http_vars;
        global $current_user;
        get_currentuserinfo();
        $rpx_comment_option = rpx_get_comment_option();
        add_action(RPX_TOKEN_ACTION_NAME, 'rpx_process_token');
        add_action(RPX_REGISTER_FORM_ACTION_NAME, 'rpx_register');
        add_action(RPX_REMOVE_ACTION_NAME, 'rpx_remove_usermeta');
        add_action(RPX_DATA_MODE_ACTION_NAME, 'rpx_process_token');
        if ($rpx_http_vars['action'] == RPX_TOKEN_ACTION) {
            do_action(RPX_TOKEN_ACTION_NAME);
        }
        if ($rpx_http_vars['action'] == RPX_REGISTER_FORM_ACTION) {
            do_action(RPX_REGISTER_FORM_ACTION_NAME);
        }
        if ($rpx_http_vars['action'] == RPX_REMOVE_ACTION) {
            do_action(RPX_REMOVE_ACTION_NAME);
        }
        if ($rpx_http_vars['action'] == RPX_DATA_MODE_ACTION) {
            do_action(RPX_DATA_MODE_ACTION_NAME);
        }
        add_action('login_head', 'rpx_login_head');
        add_action('login_form', 'rpx_login_form');
        add_action('register_form', 'rpx_login_form');
        if (!empty($rpx_comment_option)) {
            add_action($rpx_comment_option, 'rpx_comment_login');
        }
        //add_action('comment_form_logged_in_after', 'rpx_share_comment');
        //wp_register_sidebar_widget('rpx_widget', 'Old '.RPX_WIDGET_TITLE.' widget', 'rpx_widget');//deprecated
        add_filter('the_content', 'rpx_content_filter');
        add_filter('comment_text', 'rpx_comment_filter');
        add_filter('get_comment_author_link', 'rpx_user_provider_icon');
        add_filter('get_avatar', 'rpx_avatar_filter');
        add_filter('manage_users_columns', 'rpx_add_custom_column');
        add_filter('manage_users_custom_column', 'rpx_custom_column', 10, 3);
        add_filter('manage_users_sortable_columns', 'rpx_add_custom_column');
        add_filter('request', 'rpx_column_orderby');
        add_action('wp_footer', 'rpx_wp_footer');
        add_action('admin_head', 'rpx_inline_javascript', 10);
        add_action('admin_footer', 'rpx_wp_footer', 10);
        add_action('bp_include', 'rpx_bp_init');
        //Detect BuddyPress for reg URL
        add_action('show_user_profile', 'rpx_edit_user_profile');
        add_action('edit_user_profile', 'rpx_admin_edit_user_profile');
        add_shortcode('rpxshare', 'rpxshare_shortcode');
        add_shortcode('rpxlogin', 'rpxlogin_shortcode');
        add_shortcode('rpxdata', 'rpxdata_shortcode');
        add_shortcode('rpxwidget', 'rpxwidget_shortcode');
        add_shortcode('rpxavatar', 'rpxavatar_shortcode');
        add_shortcode('rpxuser', 'rpxuser_shortcode');
        add_shortcode('rpxnotuser', 'rpxnotuser_shortcode');
    } else {
        rpx_activate();
    }
    add_action('wp_head', 'rpx_inline_stylesheet', 11);
    add_action('wp_head', 'rpx_inline_javascript', 12);
    add_action('admin_print_styles', 'rpx_inline_stylesheet', 11);
    add_action('wp_print_styles', 'rpx_stylesheet', 11);
    add_action('wp_print_scripts', 'rpx_javascript', 11);
    add_action('admin_print_styles', 'rpx_admin_stylesheet', 11);
    add_action('admin_menu', 'rpx_admin_menu');
    return true;
}