This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function loginpress_reset_password_email( $message ) { | |
$user_data = ''; | |
// If no value is posted, return false | |
if( ! isset( $_POST['user_login'] ) ) { | |
return ''; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add the following CSS snippet in LoginPress > Custom CSS/JS > Custom CSS section to vertically align center the login form. | |
body.login { | |
display: block !important; | |
} | |
#login { | |
position: absolute !important; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* You've to download `cacert.pem` file from here => https://d.pr/f/p89oI5 and place it into the plugins SDK folder. | |
* Path => wp-content/plugins/loginpres-social-login/sdk/ | |
* After that, copy the following PHP snippet and place it into loginpress-social-check.php # 198 after the object of Google_Client(); | |
* Helping Screenshot => https://d.pr/i/IzIRNZ | |
* File path => wp-content/plugins/loginpres-social-login/classes/loginpress-social-check.php | |
* @since LoginPress - Socila Login version 1.4.0 while Google SDK version 2.7.0 */ | |
$gClient->setHttpClient(new \GuzzleHttp\Client(array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** For removing "|" symbol, that fall between 2 links. */ | |
.login-action-login #nav, .login-action-lostpassword #nav { | |
font-size: 0; | |
} | |
/** For removing registration link on login form. */ | |
.login-action-login #nav a:first-child{ | |
display: none; | |
} | |
/** For removing registration link on lost password form. */ | |
.login-action-lostpassword #nav a:nth-child(2){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ab610_wp_new_user_notification_email( $wp_new_user_notification ) { | |
$wp_new_user_notification['to'] = ''; | |
return $wp_new_user_notification; | |
} | |
add_filter( 'wp_new_user_notification_email', 'ab610_wp_new_user_notification_email' ); | |
// We can use `wp_new_user_notification_email_admin` filter for turn off the admin notification. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_variation_option_name', 'ab610_display_price_in_variation_option_name' ); | |
function ab610_display_price_in_variation_option_name( $term ) { | |
global $wpdb, $product; | |
$result = $wpdb->get_col( "SELECT slug FROM {$wpdb->prefix}terms WHERE name = '$term'" ); | |
$term_slug = ( !empty( $result ) ) ? $result[0] : $term; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'template_redirect', 'redirect_your_post_type_single' ); | |
function redirect_your_post_type_single(){ | |
if ( ! is_singular( 'YOUR-CUSTOM-POST-TYPE' ) ) | |
return; | |
wp_redirect( get_page_link( YOUR-PAGE-ID ), 301 ); | |
// or | |
// wp_redirect( get_post_type_archive_link( 'ANOTHER-CUSTOM-POST-TYPE' ), 301 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Function to change email address. | |
function ab610_sender_email( $original_email_address ) { | |
return '[email protected]'; | |
} | |
// Function to change sender name. | |
function ab610_sender_name( $original_email_from ) { | |
return 'Site or Your Name'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'register_form', 'loginpress_plugin_register_form_custom_field' ); | |
function loginpress_plugin_register_form_custom_field() { | |
$first_name = ( ! empty( $_POST['first_name'] ) ) ? trim( $_POST['first_name'] ) : ''; | |
$last_name = ( ! empty( $_POST['last_name'] ) ) ? trim( $_POST['last_name'] ) : ''; ?> | |
<p> | |
<label for="first_name"> | |
<?php _e( 'First Name', 'loginpress' ) ?><br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'login_redirect', function ( $redirect_to, $requested_redirect_to, $user ) { | |
if ( ! $requested_redirect_to ) { | |
$redirect_to = wp_get_referer(); | |
} | |
return $redirect_to; | |
}, 10, 3 ); |
NewerOlder