diff --git a/media.php b/media.php index d737022..77001e1 100644 --- a/media.php +++ b/media.php @@ -2,19 +2,13 @@ function sc_add_stylesheets(){ if( !wp_style_is( 'social_connect', 'registered' ) ) { - wp_register_style( "social_connect", SOCIAL_CONNECT_PLUGIN_URL . "/media/css/style.css" ); - } - - if ( did_action( 'wp_print_styles' ) ) { - wp_print_styles( 'social_connect' ); - wp_print_styles( 'wp-jquery-ui-dialog' ); - } else { + wp_register_style( "social_connect", SOCIAL_CONNECT_PLUGIN_URL . "/media/css/style.css", "wp-jquery-ui-dialog" ); wp_enqueue_style( "social_connect" ); wp_enqueue_style( "wp-jquery-ui-dialog" ); } } add_action( 'login_enqueue_scripts', 'sc_add_stylesheets' ); -add_action( 'wp_head', 'sc_add_stylesheets' ); +add_action( 'wp_enqueue_scripts', 'sc_add_stylesheets' ); function sc_add_admin_stylesheets(){ @@ -40,7 +34,7 @@ function sc_add_javascripts(){ } if( ! wp_script_is( 'social_connect', 'registered' ) ) - wp_register_script( 'social_connect', SOCIAL_CONNECT_PLUGIN_URL . '/media/js/connect.js', $deps ); + wp_register_script( 'social_connect', SOCIAL_CONNECT_PLUGIN_URL . '/media/js/connect.js', $deps, false, true ); wp_enqueue_script( 'social_connect' ); wp_localize_script( 'social_connect', 'social_connect_data', array( 'wordpress_enabled' => $wordpress_enabled ) ); diff --git a/social-connect.php b/social-connect.php index 29e7641..c118288 100644 --- a/social-connect.php +++ b/social-connect.php @@ -206,6 +206,8 @@ function sc_social_connect_process_login( $is_ajax = false ) { break; } + $user_login = apply_filters( 'social_connect_user_login', $user_login, $sc_email, $sc_first_name, $sc_last_name, $social_connect_provider ); + // Cookies used to display welcome message if already signed in recently using some provider setcookie("social_connect_current_provider", $social_connect_provider, time()+3600, SITECOOKIEPATH, COOKIE_DOMAIN, false, true );