Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for custom user_login values and enqueue styles correctly #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions media.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand All @@ -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 ) );
Expand Down
2 changes: 2 additions & 0 deletions social-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down