Skip to content

Instantly share code, notes, and snippets.

@bekarice
Last active February 4, 2019 23:16
Show Gist options
  • Save bekarice/356b5de1a15cf29e8526 to your computer and use it in GitHub Desktop.
Save bekarice/356b5de1a15cf29e8526 to your computer and use it in GitHub Desktop.
Change social login button text everywhere!
// Changes the login text from what's set in our WooCommerce settings so we're not talking about checkout elsewhere.
function change_social_login_text_option( $login_text ) {
global $pagenow;
// Only modify the text from this option if we're not on the wp-login page
if( 'wp-login.php' === $pagenow ) {
$login_text = __( 'You can also create an account with a social network.', 'WC_Social_Login' );
// Adjust the login text as desired
} elseif( ! ( is_admin() || is_woocommerce() || is_cart() || is_checkout() ) ) {
// Okay if we're not on an admin or WooCommerce page, then we also want to change it:
$login_text = __( 'Create an account with social login in 12 seconds or complete the fields below.', 'WC_Social_Login' );
// Adjust the login text as desired
}
return $login_text;
}
add_filter( 'pre_option_wc_social_login_text', 'change_social_login_text_option' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment